简体   繁体   English

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

[英]Im trying to install Box2D to python but i didn't succeed

Me and my friend are trying to create a simulator based on python so we wanted to use Box2D.我和我的朋友正在尝试创建一个基于 python 的模拟器,所以我们想使用 Box2D。 im trying to install box2d to python 3.6 using pip install Box2D but it shows me this -我正在尝试使用pip install Box2Dpip install 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.

I ended up using pymunk, its pretty good from what ive seen.我最终使用了 pymunk,从我所看到的来看,它非常好。 its not exectly an answer to my question but it might help someone它不完全是我问题的答案,但它可能会帮助某人

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM