hhatto / pgmagick

pgmagick is a yet another boost.python based wrapper for GraphicsMagick/ImageMagick.
MIT License
147 stars 33 forks source link

Installation fails: ld: library not found for -lboost_python #58

Closed FranzFelberer closed 3 years ago

FranzFelberer commented 4 years ago

Dear all, I try to install pgmagick on MacOS 10.15.2.

$ brew install python
$ brew install graphicsmagick
$ brew install boost-python3
$ pip install pgmagick

It fails at $ pip install pgmagick Installation via $ brew install pgmagick works

I use pyenv to manage python versions and virtual environments.

clang++ -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl@1.1/lib -L/Users/work/.pyenv/versions/3.6.10/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl@1.1/lib -L/Users/work/.pyenv/versions/3.6.10/lib build/temp.macosx-10.15-x86_64-3.6/./src/_Blob.o build/temp.macosx-10.15-x86_64-3.6/./src/_ChannelType.o build/temp.macosx-10.15-x86_64-3.6/./src/_Color.o build/temp.macosx-10.15-x86_64-3.6/./src/_ColorspaceType.o build/temp.macosx-10.15-x86_64-3.6/./src/_CompositeOperator.o build/temp.macosx-10.15-x86_64-3.6/./src/_CompressionType.o build/temp.macosx-10.15-x86_64-3.6/./src/_Coordinate.o build/temp.macosx-10.15-x86_64-3.6/./src/_DecorationType.o build/temp.macosx-10.15-x86_64-3.6/./src/_DistortImageMethod.o build/temp.macosx-10.15-x86_64-3.6/./src/_Drawable.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableAffine.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableArc.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableBezier.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableCircle.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableClipPath.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableColor.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableCompositeImage.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableDashArray.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableDashOffset.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableEllipse.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableFillColor.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableFillOpacity.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableFillRule.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableFont.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableGravity.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableLine.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableMatte.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableMiterLimit.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePath.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePoint.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePointSize.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePolygon.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePolyline.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePopClipPath.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePopGraphicContext.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePopPattern.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePushClipPath.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePushGraphicContext.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawablePushPattern.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableRectangle.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableRotation.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableRoundRectangle.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableScaling.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableSkewX.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableSkewY.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableStrokeAntialias.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableStrokeColor.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableStrokeLineCap.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableStrokeLineJoin.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableStrokeOpacity.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableStrokeWidth.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableText.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableTextAntialias.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableTextDecoration.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableTextUnderColor.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableTranslation.o build/temp.macosx-10.15-x86_64-3.6/./src/_DrawableViewbox.o build/temp.macosx-10.15-x86_64-3.6/./src/_EndianType.o build/temp.macosx-10.15-x86_64-3.6/./src/_Exception.o build/temp.macosx-10.15-x86_64-3.6/./src/_FillRule.o build/temp.macosx-10.15-x86_64-3.6/./src/_FilterTypes.o build/temp.macosx-10.15-x86_64-3.6/./src/_Geometry.o build/temp.macosx-10.15-x86_64-3.6/./src/_GravityType.o build/temp.macosx-10.15-x86_64-3.6/./src/_Image.o build/temp.macosx-10.15-x86_64-3.6/./src/_ImageType.o build/temp.macosx-10.15-x86_64-3.6/./src/_InterlaceType.o build/temp.macosx-10.15-x86_64-3.6/./src/_LineCap.o build/temp.macosx-10.15-x86_64-3.6/./src/_LineJoin.o build/temp.macosx-10.15-x86_64-3.6/./src/_Montage.o build/temp.macosx-10.15-x86_64-3.6/./src/_NoiseType.o build/temp.macosx-10.15-x86_64-3.6/./src/_OrientationType.o build/temp.macosx-10.15-x86_64-3.6/./src/_PaintMethod.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathArcAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathArcArgs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathArcRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathClosePath.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathCurvetoAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathCurvetoArgs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathCurvetoRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathLinetoAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathLinetoHorizontalAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathLinetoHorizontalRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathLinetoRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathLinetoVerticalAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathLinetoVerticalRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathMovetoAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathMovetoRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathQuadraticCurvetoAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathQuadraticCurvetoArgs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathQuadraticCurvetoRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathSmoothCurvetoAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathSmoothCurvetoRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathSmoothQuadraticCurvetoAbs.o build/temp.macosx-10.15-x86_64-3.6/./src/_PathSmoothQuadraticCurvetoRel.o build/temp.macosx-10.15-x86_64-3.6/./src/_Pixels.o build/temp.macosx-10.15-x86_64-3.6/./src/_QuantumOperator.o build/temp.macosx-10.15-x86_64-3.6/./src/_QuantumType.o build/temp.macosx-10.15-x86_64-3.6/./src/_RenderingIntent.o build/temp.macosx-10.15-x86_64-3.6/./src/_ResolutionType.o build/temp.macosx-10.15-x86_64-3.6/./src/_STL.o build/temp.macosx-10.15-x86_64-3.6/./src/_SparseColorMethod.o build/temp.macosx-10.15-x86_64-3.6/./src/_StorageType.o build/temp.macosx-10.15-x86_64-3.6/./src/_StretchType.o build/temp.macosx-10.15-x86_64-3.6/./src/_StyleType.o build/temp.macosx-10.15-x86_64-3.6/./src/_TypeMetric.o build/temp.macosx-10.15-x86_64-3.6/./src/_VPath.o build/temp.macosx-10.15-x86_64-3.6/./src/_VirtualPixelMethod.o build/temp.macosx-10.15-x86_64-3.6/./src/_gminfo.o build/temp.macosx-10.15-x86_64-3.6/./src/_main.o -L/usr/local/lib/ -lboost_python -lGraphicsMagick++ -o build/lib.macosx-10.15-x86_64-3.6/pgmagick/_pgmagick.cpython-36m-darwin.so ld: library not found for -lboost_python clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang++' failed with exit status 1

ERROR: Command errored out with exit status 1: /Users/work/.pyenv/versions/3.6.10/envs/python-openvc/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/r9/jl4xsb3j6kjcz2zv3j4ypl4c0000gq/T/pip-install-b1845iss/pgmagick/setup.py'"'"'; file='"'"'/private/var/folders/r9/jl4xsb3j6kjcz2zv3j4ypl4c0000gq/T/pip-install-b1845iss/pgmagick/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/r9/jl4xsb3j6kjcz2zv3j4ypl4c0000gq/T/pip-record-th4ohgq2/install-record.txt --single-version-externally-managed --compile --install-headers /Users/work/.pyenv/versions/3.6.10/envs/python-openvc/include/site/python3.6/pgmagick Check the logs for full command output.

hhatto commented 4 years ago

@FranzFelberer Looks like you are using pyenv's Python. You need to use Python installed with Homebrew.

There is one more thing you want to check. I want to share the result of under a command execution:

$ find /usr -name "*libboost_python*"

Thanks

FranzFelberer commented 4 years ago

@hhatto Thanks for your response. Ok, I see. Is there a way to install it / make it available to a python version/virtual environment not installed by homebrew?

The output:

❯ sudo find /usr -name "libboost_python" /usr/local/lib/libboost_python27.a /usr/local/lib/libboost_python27-mt.a /usr/local/lib/libboost_python37.a /usr/local/lib/libboost_python37.dylib /usr/local/lib/libboost_python37-mt.a /usr/local/lib/libboost_python27.dylib /usr/local/lib/libboost_python37-mt.dylib /usr/local/lib/libboost_python27-mt.dylib /usr/local/Cellar/boost-python3/1.72.0/lib/libboost_python37.a /usr/local/Cellar/boost-python3/1.72.0/lib/libboost_python37.dylib /usr/local/Cellar/boost-python3/1.72.0/lib/cmake/boost_python-1.72.0/libboost_python-variant-mt-static-py3.7.cmake /usr/local/Cellar/boost-python3/1.72.0/lib/cmake/boost_python-1.72.0/libboost_python-variant-mt-shared-py3.7.cmake /usr/local/Cellar/boost-python3/1.72.0/lib/cmake/boost_python-1.72.0/libboost_python-variant-static-py3.7.cmake /usr/local/Cellar/boost-python3/1.72.0/lib/cmake/boost_python-1.72.0/libboost_python-variant-shared-py3.7.cmake /usr/local/Cellar/boost-python3/1.72.0/lib/libboost_python37-mt.a /usr/local/Cellar/boost-python3/1.72.0/lib/libboost_python.dylib /usr/local/Cellar/boost-python3/1.72.0/lib/libboost_python37-mt.dylib /usr/local/Cellar/boost-python3/1.72.0/lib/libboost_python3.dylib /usr/local/Cellar/boost-python/1.72.0/lib/libboost_python27.a /usr/local/Cellar/boost-python/1.72.0/lib/libboost_python27-mt.a /usr/local/Cellar/boost-python/1.72.0/lib/libboost_python27.dylib /usr/local/Cellar/boost-python/1.72.0/lib/libboost_python27-mt.dylib

hhatto commented 3 years ago

@FranzFelberer sorry for late reply.

Is there a way to install it / make it available to a python version/virtual environment not installed by homebrew?

To do that, you also need to install boost-python. In that case, you need to link to the version of Python you want to use. I think that it will work if libboost_python36.a and libboost_python36-mt.a are installed.

hhatto commented 3 years ago

Close this. If the problem still occurs, reopen it.