gpt4 book ai didi

python - 在 Windows 上使用 Python 3.4 64 位构建 VRPN 服务器

转载 作者:太空宇宙 更新时间:2023-11-03 17:14:21 25 4
gpt4 key购买 nike

我正在尝试在 Windows 7 64 位上使用 Python 3.4 64 位构建带有 Python3 标志的 VRPN 服务器,但似乎存在问题。我需要这个用于 BlenderVR 软件。

这是我的程序:

  • 1)我使用CMake来创建makefile(我使用的是3.4.0版本,但我也尝试过不同的版本)。我用这个命令来做到这一点(那些标志应该在那里,但无论如何,没有它们结果似乎是相同的):

cmake -G"MinGW Makefiles"
-HD:\My\BlenderVR\plugins\vrpn
-BD:\My\BlenderVR\plugins\cmake
-DVRPN_BUILD_PYTHON=OFF
-DVRPN_BUILD_PYTHON_HANDCODED_2X=OFF
-DVRPN_BUILD_PYTHON_HANDCODED_3X=ON

我曾经也添加过这些标志,但似乎没有它们也能找到 Python

-DPYTHON_INCLUDE_DIR=D:\My\BlenderVR\Required\Python3\include
-DPYTHON_LIBRARY=D:\My\BlenderVR\Required\Python3\libs\python34.lib

Python 已正确找到,并且此操作不会引发任何错误。

  • 2) 然后我使用 mingw32-make.exe 来构建它,但出现此错误:

[ 90%] Linking CXX shared module vrpn.pyd
D:/My/BlenderVR/Required/Python3/libs/python34.lib: error adding symbols: File f ormat not recognized
collect2.exe: error: ld returned 1 exit status
python\CMakeFiles\vrpn-python.dir\build.make:505: recipe for target 'python/vrpn .pyd' failed mingw32-make[2]: * * * [python/vrpn.pyd] Error 1
CMakeFiles\Makefile2:3247: recipe for target 'python/CMakeFiles/vrpn-python.dir/ all' failed mingw32-make[1]: * * * [python/CMakeFiles/vrpn-python.dir/all]
Error 2 Makefile:159: recipe for target 'all' failed
mingw32-make: [all] Error 2

vprn.pyd对我 future 的工作至关重要。

我发现它需要libpython34.a文件(可能)。当我创建它并复制到 Python3/libs 文件夹时,它工作并完成,没有错误,但打包的 vprn.pyd 没有按预期工作。

我需要的是让 import vrpn 在 python 中进行这个简单的测试(附加构建 vrpn.pyd 的路径):

import sys
sys.path.append('D:/My/BlenderVR/plugins/cmake/python')
import vrpn

它使我的整台计算机滞后了一段时间,然后弹出 Python 已停止工作的消息。

我怀疑问题出在我创建的 libpython34.a 文件中:

gendef python34.dll (in Windows/System32)
dlltool -D python34.dll -d python34.def -l libpython34.a

我不知道我应该如何获取 libpython 文件。我尝试过各种版本的 CMake 和 MinGW(如 MinGWPy、TDM、w64)以及许多 CMake 标志。我能够使用 32 位 Python 使其工作,但我需要 64 位版本,否则它无法在 BlenderVR 环境中工作。

我知道这是一个非常具体的问题,一开始可能有点令人困惑,但我不知道该怎么说。我会很高兴有任何帮助。谢谢。

最佳答案

mingwpy 应与 pip 一起安装(直到它在 PYPI 上正式发布):

pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy

所有必需的导入文件都会自动复制到 python\libs 文件夹中。如果 python\Scripts 在 PATH 中,它应该可以开箱即用。

您必须确保 Blender Python 配备了两个导入文件

D:\My\BlenderVR\Required\Python3\libs\libpython\libpython34.dll.a
D:\My\BlenderVR\Required\Python3\libs\libpython\libmsvcr100.a

关于python - 在 Windows 上使用 Python 3.4 64 位构建 VRPN 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33781375/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com