我试图将Box2D安装到python但我没有成功

时间:2019-12-02 19:45:17

标签: python installation box2d

我和我的朋友正在尝试基于python创建一个模拟器,因此我们想使用Box2D。 我试图使用pip install Box2D将box2d安装到python 3.6,但它向我展示了-

  Using cached https://files.pythonhosted.org/packages/cc/7b/ddb96fea1fa5b24f8929714ef483f64c33e9649e7aae066e5f5023ea46a/Box2D-2.3.2.tar.gz
Installing collected packages: Box2D
    Running setup.py install for Box2D ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-0tson6el\\Box2D\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-0tson6el\\Box2D\\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-record-preupzga\install-record.txt' --single-version-externally-managed --compile
         cwd: C:\Users\user\AppData\Local\Temp\pip-install-0tson6el\Box2D\
    Complete output (16 lines):
    Using setuptools (version 42.0.2).
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\Box2D
    copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.6\Box2D
    copying library\Box2D\__init__.py -> build\lib.win-amd64-3.6\Box2D
    creating build\lib.win-amd64-3.6\Box2D\b2
    copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-3.6\Box2D\b2
    running build_ext
    building 'Box2D._Box2D' extension
    swigging Box2D\Box2D.i to Box2D\Box2D_wrap.cpp
    swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir library\Box2D -keyword -w511 -D_SWIG_KWARGS -o Box2D\Box2D_wrap.cpp Box2D\Box2D.i
    error: command 'swig.exe' failed: No such file or directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python36\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-0tson6el\\Box2D\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-0tson6el\\Box2D\\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-record-preupzga\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.```

i tried a few solutions i found online but none of them worked.
thanks for the helpers.

1 个答案:

答案 0 :(得分:0)

我最终使用了pymunk,从ive看到的效果来看,它相当不错。 它不是我的问题的明确答案,但可能会对某人有所帮助