在Windows上的Blender自定义python中,如何在模块的pip安装过程中修复“无法解析的外部符号”?

时间:2019-05-19 07:43:25

标签: python windows blender

对于附加组件,我正在尝试安装pip模块pyhull,用于侧面加载了Blender(或更具体地说,是OTOY推出的Blender版本的OctaneBlender)的自定义python。我已经能够在OSX中成功完成此工作。

我已经克服了几个问题:正确设置Visual Studio C ++生成工具,找到Python.h,找到pyconfig.h等。一切似乎都可以正常编译。但是我在链接步骤中死了。

最初是抱怨缺少文件python35.lib,所以我安装了与sys.version相匹配的Blender python侧载的官方CPython版本,并从CPython版本中窃取了libs/文件夹并将其粘贴在Blender的python主页中。可能只是这个lib不兼容;但是如果是这样,我不明白如何获取Blender的python需要的.lib文件。否则,我很想知道如何克服这些少数的缺失链接:

完整要点:https://gist.github.com/jadowdl/20ba0b7a4a60c964947a8b8d9ab1ba99

C:\PROGRA~1\BlenderOctane\2.79\python\bin>.\python -m pip install pyhull --user
Collecting pyhull
  Using cached https://files.pythonhosted.org/packages/2d/5e/1dab36627c5855dacf206ccecc78c91ad7cfe614187c93643044fabdd934/pyhull-2015.2.1.tar.gz
Requirement already satisfied: numpy in c:\users\jdowdell\appdata\roaming\python\python35\site-packages (from pyhull) (1.16.3)
Building wheels for collected packages: pyhull
  Building wheel for pyhull (setup.py) ... error
  ERROR: Complete output from command 'C:\PROGRA~1\BlenderOctane\2.79\python\bin\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\JDOWDELL~1\\AppData\\Local\\Temp\\pip-install-g9k83_52\\pyhull\\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\JDOWDELL~1\AppData\Local\Temp\pip-wheel-ld2id_zn' --python-tag cp35:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.5
  creating build\lib.win-amd64-3.5\pyhull
  copying pyhull\convex_hull.py -> build\lib.win-amd64-3.5\pyhull
  copying pyhull\delaunay.py -> build\lib.win-amd64-3.5\pyhull
  copying pyhull\halfspace.py -> build\lib.win-amd64-3.5\pyhull
  copying pyhull\simplex.py -> build\lib.win-amd64-3.5\pyhull
  copying pyhull\voronoi.py -> build\lib.win-amd64-3.5\pyhull
  copying pyhull\__init__.py -> build\lib.win-amd64-3.5\pyhull
  running build_ext
  building 'pyhull._pyhull' extension
  creating build\temp.win-amd64-3.5
  creating build\temp.win-amd64-3.5\Release
  creating build\temp.win-amd64-3.5\Release\src
  creating build\temp.win-amd64-3.5\Release\src\libqhull
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc\libqhull -IC:\PROGRA~1\BlenderOctane\2.79\python\include -IC:\PROGRA~1\BlenderOctane\2.79\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.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" /Tcsrc\_pyhull.c /Fobuild\temp.win-amd64-3.5\Release\src\_pyhull.obj
  _pyhull.c
  src\_pyhull.c(85): warning C4013: '_open_osfhandle' undefined; assuming extern returning int
  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:C:\PROGRA~1\BlenderOctane\2.79\python\libs /LIBPATH:C:\PROGRA~1\BlenderOctane\2.79\python\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft 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.17763.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64" /EXPORT:PyInit__pyhull build\temp.win-amd64-3.5\Release\src\_pyhull.obj build\temp.win-amd64-3.5\Release\src\libqhull\geom.obj build\temp.win-amd64-3.5\Release\src\libqhull\geom2.obj build\temp.win-amd64-3.5\Release\src\libqhull\global.obj build\temp.win-amd64-3.5\Release\src\libqhull\io.obj build\temp.win-amd64-3.5\Release\src\libqhull\libqhull.obj build\temp.win-amd64-3.5\Release\src\libqhull\mem.obj build\temp.win-amd64-3.5\Release\src\libqhull\merge.obj build\temp.win-amd64-3.5\Release\src\libqhull\poly.obj build\temp.win-amd64-3.5\Release\src\libqhull\poly2.obj build\temp.win-amd64-3.5\Release\src\libqhull\qset.obj build\temp.win-amd64-3.5\Release\src\libqhull\random.obj build\temp.win-amd64-3.5\Release\src\libqhull\rboxlib.obj build\temp.win-amd64-3.5\Release\src\libqhull\stat.obj build\temp.win-amd64-3.5\Release\src\libqhull\user.obj build\temp.win-amd64-3.5\Release\src\libqhull\usermem.obj build\temp.win-amd64-3.5\Release\src\libqhull\userprintf.obj build\temp.win-amd64-3.5\Release\src\libqhull\userprintf_rbox.obj /OUT:build\lib.win-amd64-3.5\pyhull\_pyhull.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\src\_pyhull.cp35-win_amd64.lib

  [...REDACTED...] 

  _pyhull.obj : warning LNK4197: export 'PyInit__pyhull' specified multiple times; using first specification
     Creating library build\temp.win-amd64-3.5\Release\src\_pyhull.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\src\_pyhull.cp35-win_amd64.exp
  _pyhull.obj : error LNK2001: unresolved external symbol __imp_Py_BuildValue
  _pyhull.obj : error LNK2001: unresolved external symbol __imp_PyModule_Create2
  _pyhull.obj : error LNK2001: unresolved external symbol __imp_PyModule_GetState
  _pyhull.obj : error LNK2001: unresolved external symbol __imp_PyArg_ParseTuple
  build\lib.win-amd64-3.5\pyhull\_pyhull.cp35-win_amd64.pyd : fatal error LNK1120: 4 unresolved externals
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120
  ----------------------------------------
  ERROR: Failed building wheel for pyhull
  Running setup.py clean for pyhull
Failed to build pyhull
Installing collected packages: pyhull
  Running setup.py install for pyhull ... error
    ERROR: Complete output from command 'C:\PROGRA~1\BlenderOctane\2.79\python\bin\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\JDOWDELL~1\\AppData\\Local\\Temp\\pip-install-g9k83_52\\pyhull\\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\JDOWDELL~1\AppData\Local\Temp\pip-record-b5_gxzqz\install-record.txt' --single-version-externally-managed --compile --user --prefix=:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.5
    creating build\lib.win-amd64-3.5\pyhull
    copying pyhull\convex_hull.py -> build\lib.win-amd64-3.5\pyhull
    copying pyhull\delaunay.py -> build\lib.win-amd64-3.5\pyhull
    copying pyhull\halfspace.py -> build\lib.win-amd64-3.5\pyhull
    copying pyhull\simplex.py -> build\lib.win-amd64-3.5\pyhull
    copying pyhull\voronoi.py -> build\lib.win-amd64-3.5\pyhull
    copying pyhull\__init__.py -> build\lib.win-amd64-3.5\pyhull
    running build_ext
    building 'pyhull._pyhull' extension
    creating build\temp.win-amd64-3.5
    creating build\temp.win-amd64-3.5\Release
    creating build\temp.win-amd64-3.5\Release\src
    creating build\temp.win-amd64-3.5\Release\src\libqhull

    [...REDACTED...]

    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:C:\PROGRA~1\BlenderOctane\2.79\python\libs /LIBPATH:C:\PROGRA~1\BlenderOctane\2.79\python\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft 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.17763.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64" /EXPORT:PyInit__pyhull build\temp.win-amd64-3.5\Release\src\_pyhull.obj build\temp.win-amd64-3.5\Release\src\libqhull\geom.obj build\temp.win-amd64-3.5\Release\src\libqhull\geom2.obj build\temp.win-amd64-3.5\Release\src\libqhull\global.obj build\temp.win-amd64-3.5\Release\src\libqhull\io.obj build\temp.win-amd64-3.5\Release\src\libqhull\libqhull.obj build\temp.win-amd64-3.5\Release\src\libqhull\mem.obj build\temp.win-amd64-3.5\Release\src\libqhull\merge.obj build\temp.win-amd64-3.5\Release\src\libqhull\poly.obj build\temp.win-amd64-3.5\Release\src\libqhull\poly2.obj build\temp.win-amd64-3.5\Release\src\libqhull\qset.obj build\temp.win-amd64-3.5\Release\src\libqhull\random.obj build\temp.win-amd64-3.5\Release\src\libqhull\rboxlib.obj build\temp.win-amd64-3.5\Release\src\libqhull\stat.obj build\temp.win-amd64-3.5\Release\src\libqhull\user.obj build\temp.win-amd64-3.5\Release\src\libqhull\usermem.obj build\temp.win-amd64-3.5\Release\src\libqhull\userprintf.obj build\temp.win-amd64-3.5\Release\src\libqhull\userprintf_rbox.obj /OUT:build\lib.win-amd64-3.5\pyhull\_pyhull.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\src\_pyhull.cp35-win_amd64.lib
    _pyhull.obj : warning LNK4197: export 'PyInit__pyhull' specified multiple times; using first specification
       Creating library build\temp.win-amd64-3.5\Release\src\_pyhull.cp35-win_amd64.lib and object build\temp.win-amd64-3.5\Release\src\_pyhull.cp35-win_amd64.exp
    _pyhull.obj : error LNK2001: unresolved external symbol __imp_Py_BuildValue
    _pyhull.obj : error LNK2001: unresolved external symbol __imp_PyModule_Create2
    _pyhull.obj : error LNK2001: unresolved external symbol __imp_PyModule_GetState
    _pyhull.obj : error LNK2001: unresolved external symbol __imp_PyArg_ParseTuple
    build\lib.win-amd64-3.5\pyhull\_pyhull.cp35-win_amd64.pyd : fatal error LNK1120: 4 unresolved externals
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120
    ----------------------------------------
ERROR: Command "'C:\PROGRA~1\BlenderOctane\2.79\python\bin\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\JDOWDELL~1\\AppData\\Local\\Temp\\pip-install-g9k83_52\\pyhull\\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\JDOWDELL~1\AppData\Local\Temp\pip-record-b5_gxzqz\install-record.txt' --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in C:\Users\JDOWDELL~1\AppData\Local\Temp\pip-install-g9k83_52\pyhull\

0 个答案:

没有答案