V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
tg11
V2EX  ›  Python

关于安装 pydensecrf 的问题求助

  •  
  •   tg11 · 2021-11-20 02:07:18 +08:00 · 1764 次点击
    这是一个创建于 1100 天前的主题,其中的信息可能已经有所发展或是发生改变。

    查了好多资料都没能行。有的说是因为 system32 不在环境变量,添加进去也没管用。 有的教程让在Visual C++ 2015 x64 Native Build Tools Command Prompt里运行"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat",这个报错ERROR: Cannot determine the location of the VS Common Tools folder.。(我确实是 64 位 win10 ,也是管理员身份运行的)

    想用 conda 安装,但是 conda 中的 pydensecrf <= py3.7 ,程序是 py3.8 的。

    现在就是很走投无路。下面是用 pip 安装时报的错

    Building wheels for collected packages: pydensecrf
      Building wheel for pydensecrf (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: 'D:\PyCodeProject\manga-image-translator-main\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gii\\AppData\\Local\\Temp\\pip-install-y0dj_q4l\\pydensecrf_bbf
    5ced7d4e74a039adcdd868c101d0e\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gii\\AppData\\Local\\Temp\\pip-install-y0dj_q4l\\pydensecrf_bbf5ced7d4e74a039adcdd868c101d0e\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__
    file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel
    -d 'C:\Users\Gii\AppData\Local\Temp\pip-wheel-4y5ux1x0'
           cwd: C:\Users\Gii\AppData\Local\Temp\pip-install-y0dj_q4l\pydensecrf_bbf5ced7d4e74a039adcdd868c101d0e\
      Complete output (70 lines):
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.8
      creating build\lib.win-amd64-3.8\pydensecrf
      copying pydensecrf\utils.py -> build\lib.win-amd64-3.8\pydensecrf
      copying pydensecrf\__init__.py -> build\lib.win-amd64-3.8\pydensecrf
      running build_ext
      building 'pydensecrf.eigen' extension
      creating build\temp.win-amd64-3.8
      creating build\temp.win-amd64-3.8\Release
      creating build\temp.win-amd64-3.8\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 -Ipydensecrf -ID:\PyCodeProject\manga-image-translator-main\venv\include -IC:\Use
    rs\Gii\AppData\Local\Programs\Python\Python38\include -IC:\Users\Gii\AppData\Local\Programs\Python\Python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\
    include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240
    .0\winrt" /EHsc /Tppydensecrf/eigen.cpp /Fobuild\temp.win-amd64-3.8\Release\pydensecrf/eigen.obj
      eigen.cpp
      pydensecrf/eigen.cpp(15393): warning C4996: '_typeobject::tp_print': deprecated in 3.8
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
      pydensecrf/eigen.cpp(15400): warning C4996: '_typeobject::tp_print': deprecated in 3.8
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
      pydensecrf/eigen.cpp(15407): warning C4996: '_typeobject::tp_print': deprecated in 3.8
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
      pydensecrf/eigen.cpp(15411): warning C4996: '_typeobject::tp_print': deprecated in 3.8
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
      pydensecrf/eigen.cpp(15422): warning C4996: '_typeobject::tp_print': deprecated in 3.8
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
      pydensecrf/eigen.cpp(15431): warning C4996: '_typeobject::tp_print': deprecated in 3.8
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
      pydensecrf/eigen.cpp(17032): error C2039: 'exc_type': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17033): error C2039: 'exc_value': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17034): error C2039: 'exc_traceback': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17041): error C2039: 'exc_type': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17042): error C2039: 'exc_value': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17043): error C2039: 'exc_traceback': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17044): error C2039: 'exc_type': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17045): error C2039: 'exc_value': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17046): error C2039: 'exc_traceback': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17101): error C2039: 'exc_type': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17102): error C2039: 'exc_value': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17103): error C2039: 'exc_traceback': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17104): error C2039: 'exc_type': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17105): error C2039: 'exc_value': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17106): error C2039: 'exc_traceback': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17128): error C2039: 'exc_type': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17129): error C2039: 'exc_value': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17130): error C2039: 'exc_traceback': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17131): error C2039: 'exc_type': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17132): error C2039: 'exc_value': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      pydensecrf/eigen.cpp(17133): error C2039: 'exc_traceback': is not a member of '_ts'
      c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
      ----------------------------------------
      ERROR: 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
        ERROR: Command errored out with exit status 1:
         command: 'D:\PyCodeProject\manga-image-translator-main\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gii\\AppData\\Local\\Temp\\pip-install-y0dj_q4l\\pydensecrf_b
    bf5ced7d4e74a039adcdd868c101d0e\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gii\\AppData\\Local\\Temp\\pip-install-y0dj_q4l\\pydensecrf_bbf5ced7d4e74a039adcdd868c101d0e\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(
    __file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --
    record 'C:\Users\Gii\AppData\Local\Temp\pip-record-wvo03rkf\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\PyCodeProject\manga-image-translator-main\venv\include\site\python3.8\pydense
    crf'
             cwd: C:\Users\Gii\AppData\Local\Temp\pip-install-y0dj_q4l\pydensecrf_bbf5ced7d4e74a039adcdd868c101d0e\
        Complete output (70 lines):
        running install
        running build
        running build_py
        creating build
        creating build\lib.win-amd64-3.8
        creating build\lib.win-amd64-3.8\pydensecrf
        copying pydensecrf\utils.py -> build\lib.win-amd64-3.8\pydensecrf
        copying pydensecrf\__init__.py -> build\lib.win-amd64-3.8\pydensecrf
        running build_ext
        building 'pydensecrf.eigen' extension
        creating build\temp.win-amd64-3.8
        creating build\temp.win-amd64-3.8\Release
        creating build\temp.win-amd64-3.8\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 -Ipydensecrf -ID:\PyCodeProject\manga-image-translator-main\venv\include -IC:\U
    sers\Gii\AppData\Local\Programs\Python\Python38\include -IC:\Users\Gii\AppData\Local\Programs\Python\Python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\1
    0\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.102
    40.0\winrt" /EHsc /Tppydensecrf/eigen.cpp /Fobuild\temp.win-amd64-3.8\Release\pydensecrf/eigen.obj
        eigen.cpp
        pydensecrf/eigen.cpp(15393): warning C4996: '_typeobject::tp_print': deprecated in 3.8
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
        pydensecrf/eigen.cpp(15400): warning C4996: '_typeobject::tp_print': deprecated in 3.8
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
        pydensecrf/eigen.cpp(15407): warning C4996: '_typeobject::tp_print': deprecated in 3.8
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
        pydensecrf/eigen.cpp(15411): warning C4996: '_typeobject::tp_print': deprecated in 3.8
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
        pydensecrf/eigen.cpp(15422): warning C4996: '_typeobject::tp_print': deprecated in 3.8
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
        pydensecrf/eigen.cpp(15431): warning C4996: '_typeobject::tp_print': deprecated in 3.8
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/object.h(260): note: see declaration of '_typeobject::tp_print'
        pydensecrf/eigen.cpp(17032): error C2039: 'exc_type': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17033): error C2039: 'exc_value': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17034): error C2039: 'exc_traceback': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17041): error C2039: 'exc_type': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17042): error C2039: 'exc_value': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17043): error C2039: 'exc_traceback': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17044): error C2039: 'exc_type': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17045): error C2039: 'exc_value': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17046): error C2039: 'exc_traceback': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17101): error C2039: 'exc_type': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17102): error C2039: 'exc_value': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17103): error C2039: 'exc_traceback': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17104): error C2039: 'exc_type': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17105): error C2039: 'exc_value': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17106): error C2039: 'exc_traceback': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17128): error C2039: 'exc_type': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17129): error C2039: 'exc_value': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17130): error C2039: 'exc_traceback': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17131): error C2039: 'exc_type': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17132): error C2039: 'exc_value': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        pydensecrf/eigen.cpp(17133): error C2039: 'exc_traceback': is not a member of '_ts'
        c:\users\gii\appdata\local\programs\python\python38\include\cpython/pystate.h(51): note: see declaration of '_ts'
        error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
        ----------------------------------------
    ERROR: Command errored out with exit status 1: 'D:\PyCodeProject\manga-image-translator-main\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gii\\AppData\\Local\\Temp\\p
    ip-install-y0dj_q4l\\pydensecrf_bbf5ced7d4e74a039adcdd868c101d0e\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gii\\AppData\\Local\\Temp\\pip-install-y0dj_q4l\\pydensecrf_bbf5ced7d4e74a039adcdd868c101d0e\\setup.py'"'"';f = getattr
    (tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __fil
    e__, '"'"'exec'"'"'))' install --record 'C:\Users\Gii\AppData\Local\Temp\pip-record-wvo03rkf\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\PyCodeProject\manga-image-translator-main\ve
    nv\include\site\python3.8\pydensecrf' Check the logs for full command output.
    
    
    tg11
        1
    tg11  
    OP
       2021-11-22 23:58:08 +08:00
    有懂的大佬吗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1413 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:07 · PVG 01:07 · LAX 09:07 · JFK 12:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.