pip install pydensecrf报错,填坑

环境:python3.6.5/pycharm/win10

报错:

Building wheels for collected packages: pydensecrf
  Running setup.py bdist_wheel for pydensecrf ... error
  Complete output from command D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobf
nbrz\\pydensecrf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\user\AppData\Local\Temp\t
mp9hbh8zijpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\pydensecrf
  copying pydensecrf\utils.py -> build\lib.win-amd64-3.6\pydensecrf
  copying pydensecrf\__init__.py -> build\lib.win-amd64-3.6\pydensecrf
  running build_ext
  building 'pydensecrf/eigen' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\pydensecrf
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ipydensecrf/densecrf/include -ID:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\in
clude -ID:\SetupSoftware\python\include -ID:\SetupSoftware\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\
INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-
IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /EHsc /Tppydensecrf/eigen.cpp /Fobuild\temp.win-amd64-3.6\Release\pydensecrf/eigen.obj
  eigen.cpp
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ipydensecrf/densecrf/include -ID:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\in
clude -ID:\SetupSoftware\python\include -ID:\SetupSoftware\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\
INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-
IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /EHsc /Tppydensecrf/eigen_impl.cpp /Fobuild\temp.win-amd64-3.6\Release\pydensecrf/eigen_impl.
obj
  eigen_impl.cpp
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\AllProject\SemanticSegment\2_keras_deeplab
v3+_one\venv\libs /LIBPATH:D:\SetupSoftware\python\libs /LIBPATH:D:\SetupSoftware\python /LIBPATH:D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Mic
rosoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPA
TH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" /EXPORT:PyInit_pydensecrf/eigen build\temp.win-amd64-3.6\Release\pyden
secrf/eigen.obj build\temp.win-amd64-3.6\Release\pydensecrf/eigen_impl.obj /OUT:build\lib.win-amd64-3.6\pydensecrf/eigen.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\pydensecrf\eigen.cp36-win
_amd64.lib
  LINK : error LNK2001: 无法解析的外部符号 PyInit_pydensecrf/eigen
  build\temp.win-amd64-3.6\Release\pydensecrf\eigen.cp36-win_amd64.lib : fatal error LNK1120: 1 个无法解析的外部命令
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120

  ----------------------------------------
  Failed building wheel for pydensecrf
  Running setup.py clean for pydensecrf
Failed to build pydensecrf
Installing collected packages: pydensecrf
  Running setup.py install for pydensecrf ... error
    Complete output from command D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xo
bfnbrz\\pydensecrf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Te
mp\pip-dq93_efx-record\install-record.txt --single-version-externally-managed --compile --install-headers D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\include\site\python3.6\pydensecrf:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\pydensecrf
    copying pydensecrf\utils.py -> build\lib.win-amd64-3.6\pydensecrf
    copying pydensecrf\__init__.py -> build\lib.win-amd64-3.6\pydensecrf
    running build_ext
    building 'pydensecrf/eigen' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\pydensecrf
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ipydensecrf/densecrf/include -ID:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\
include -ID:\SetupSoftware\python\include -ID:\SetupSoftware\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMF
C\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared"
"-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /EHsc /Tppydensecrf/eigen.cpp /Fobuild\temp.win-amd64-3.6\Release\pydensecrf/eigen.obj
    eigen.cpp
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ipydensecrf/densecrf/include -ID:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\
include -ID:\SetupSoftware\python\include -ID:\SetupSoftware\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMF
C\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared"
"-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /EHsc /Tppydensecrf/eigen_impl.cpp /Fobuild\temp.win-amd64-3.6\Release\pydensecrf/eigen_imp
l.obj
    eigen_impl.cpp
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\AllProject\SemanticSegment\2_keras_deepl
abv3+_one\venv\libs /LIBPATH:D:\SetupSoftware\python\libs /LIBPATH:D:\SetupSoftware\python /LIBPATH:D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\M
icrosoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIB
PATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" /EXPORT:PyInit_pydensecrf/eigen build\temp.win-amd64-3.6\Release\pyd
ensecrf/eigen.obj build\temp.win-amd64-3.6\Release\pydensecrf/eigen_impl.obj /OUT:build\lib.win-amd64-3.6\pydensecrf/eigen.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\pydensecrf\eigen.cp36-w
in_amd64.lib
    LINK : error LNK2001: 无法解析的外部符号 PyInit_pydensecrf/eigen
    build\temp.win-amd64-3.6\Release\pydensecrf\eigen.cp36-win_amd64.lib : fatal error LNK1120: 1 个无法解析的外部命令
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120

    ----------------------------------------
Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\pydensecrf\\se
tup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Temp\pip-dq93_efx-reCommand "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\pydensecr
f\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Temp\pip-Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\pydens
ecrf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\TeCommand "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\py
densecrf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xo
bfnbrz\\pydensecrf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\U
sers\\use
r\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\pydensecrf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r
\n', '\n'
Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='
C:\\U
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit st
atus 11
20

    ----------------------------------------
Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__f
ile__='
C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\pydensecrf\\setup.py';f=getattr(tokenize, 'open', open)(__file__)
;code=f
.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\
Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptool
s,
tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\pydensecrf\\setup.py';f=getattr
(to
kenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'e
xec
Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptool
s-e
, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\pydensecrf\\setup.py';f=getat
te\
r(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__
    ----------------------------------------
Command "D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-build-xobfnbrz\\pydensecrf\\setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Temp\pip-dq93_efx-record\install-record.txt --single-version-externally-manage
d --compile --install-headers D:\AllProject\SemanticSegment\2_keras_deeplabv3+_one\venv\include\site\python3.6\pydensecrf" failed with error code 

解决方案:

        安装cython, 即 pip install cython

        然后再安装pydensecrf,即 pip install pydensecrf,这样就能成功了。

参考网页:https://github.com/lucasb-eyer/pydensecrf/issues/62

猜你喜欢

转载自blog.csdn.net/qq_15694045/article/details/90171332