git clone https://github.com/openai/gym
cd gym
pip install -e .
When I follow the documentation for installation it throws this error:
Failed to build box2d-py mujoco-py
DEPRECATION: Could not build wheels for box2d-py, mujoco-py which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: box2d-py, glfw, Cython, imageio, lockfile, mujoco-py, gym
Running setup.py install for box2d-py ... error
I have seen others having the same issues however they suggested that I must uninstall python 2.7 and use only python 3.
I have checked my python version and it is only 3.7 and no other versions are available so can someone help me out.
ERROR: Command errored out with exit status 1:
command: 'c:\users\m\.conda\envs\tensorflow\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\MITHIL~1\\AppData\\Local\\Temp\\pip-install-6ozh5a9c\\box2d-py\\setup.py'"'"'; __file__='"'"'C:\\Users\\m1\\AppData\\Local\\Temp\\pip-install-6ozh5a9c\\box2d-py\\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\M~1\AppData\Local\Temp\pip-wheel-gruiq9b6'
cwd: C:\Users\M~1\AppData\Local\Temp\pip-install-6ozh5a9c\box2d-py\
Complete output (16 lines):
Using setuptools (version 49.6.0.post20200814).
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\Box2D
copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.7\Box2D
copying library\Box2D\__init__.py -> build\lib.win-amd64-3.7\Box2D
creating build\lib.win-amd64-3.7\Box2D\b2
copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-3.7\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: Failed building wheel for box2d-py
Running setup.py clean for box2d-py
Failed to build box2d-py
Installing collected packages: box2d-py
Running setup.py install for box2d-py ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\m\.conda\envs\tensorflow\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\M~1\\AppData\\Local\\Temp\\pip-install-6ozh5a9c\\box2d-py\\setup.py'"'"'; __file__='"'"'C:\\Users\\M~1\\AppData\\Local\\Temp\\pip-install-6ozh5a9c\\box2d-py\\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\M~1\AppData\Local\Temp\pip-record-67o7g705\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\m\.conda\envs\tensorflow\Include\box2d-py'
cwd: C:\Users\M~1\AppData\Local\Temp\pip-install-6ozh5a9c\box2d-py\
Complete output (16 lines):
Using setuptools (version 49.6.0.post20200814).
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\Box2D
copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.7\Box2D
copying library\Box2D\__init__.py -> build\lib.win-amd64-3.7\Box2D
creating build\lib.win-amd64-3.7\Box2D\b2
copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-3.7\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:\users\m\.conda\envs\tensorflow\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\MITHIL~1\\AppData\\Local\\Temp\\pip-install-6ozh5a9c\\box2d-py\\setup.py'"'"'; __file__='"'"'C:\\Users\\M~1\\AppData\\Local\\Temp\\pip-install-6ozh5a9c\\box2d-py\\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\M~1\AppData\Local\Temp\pip-record-67o7g705\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\m\.conda\envs\tensorflow\Include\box2d-py'
Check the logs for full command output
Try this:
pip install gym==0.7.4
This is a lite version.
You might also need to run the following:
$ apt-get install -y libglu1-mesa-dev libgl1-mesa-dev libosmesa6-dev xvfb ffmpeg curl patchelf libglfw3 libglfw3-dev cmake zlib1g zlib1g-dev swig
Solution for very similar problem
I had very similar problem with instalation Box2 as tensorflow docs stated
pip install gym[Box2D]
Error log was pretty similar
Complete output (18 lines):
Using setuptools (version 61.2.0).
running install
C:\Users\Greg\anaconda3\envs\driver\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\Box2D
copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.8\Box2D
copying library\Box2D\__init__.py -> build\lib.win-amd64-3.8\Box2D
creating build\lib.win-amd64-3.8\Box2D\b2
copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-3.8\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: None
but I have found very simple solution:
pip install Box2D
Newest modules that work for me:
Box2D==2.3.10
gym==0.24.0
Related
When trying to import 'pyheif' in a python 3 program, I get this crash dump below.
Can anyone explain how to successfully import this package? I have tried multiple versions, made sure "wheel" was installed, etc., searched Stack and done other searches but have not found out how to resolve.
Thanks in advance!
Collecting pyheif
Using cached pyheif-0.5.1.tar.gz (17 kB)
Requirement already satisfied: cffi>=1.0.0 in /Users/user/venv/HEICToJPG/lib/python3.8/site-packages (from pyheif) (1.14.4)
Requirement already satisfied: pycparser in /Users/user/venv/HEICToJPG/lib/python3.8/site-packages (from cffi>=1.0.0->pyheif) (2.20)
Building wheels for collected packages: pyheif
Building wheel for pyheif (setup.py): started
Building wheel for pyheif (setup.py): finished with status 'error'
Running setup.py clean for pyheif
Failed to build pyheif
Installing collected packages: pyheif
Running setup.py install for pyheif: started
Running setup.py install for pyheif: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/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 /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-wheel-8kzdauau
cwd: /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/
Complete output (27 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/error.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/constants.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/reader.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/writer.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
creating build/lib.macosx-10.9-x86_64-3.8/pyheif/data
copying pyheif/data/version.txt -> build/lib.macosx-10.9-x86_64-3.8/pyheif/data
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c'
creating build/temp.macosx-10.9-x86_64-3.8
building '_libheif_cffi' extension
creating build/temp.macosx-10.9-x86_64-3.8/build
creating build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/local/include -I/usr/include -I/Users/user/venv/HEICToJPG/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c -o build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.o
build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c:570:15: fatal error: 'libheif/heif.h' file not found
#include "libheif/heif.h"
^~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyheif
ERROR: Command errored out with exit status 1:
command: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-record-phe46c7r/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/venv/HEICToJPG/include/site/python3.8/pyheif
cwd: /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/
Complete output (27 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/error.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/constants.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/reader.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/writer.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
creating build/lib.macosx-10.9-x86_64-3.8/pyheif/data
copying pyheif/data/version.txt -> build/lib.macosx-10.9-x86_64-3.8/pyheif/data
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c'
creating build/temp.macosx-10.9-x86_64-3.8
building '_libheif_cffi' extension
creating build/temp.macosx-10.9-x86_64-3.8/build
creating build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/local/include -I/usr/include -I/Users/user/venv/HEICToJPG/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c -o build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.o
build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c:570:15: fatal error: 'libheif/heif.h' file not found
#include "libheif/heif.h"
^~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-record-phe46c7r/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/venv/HEICToJPG/include/site/python3.8/pyheif Check the logs for full command output.
We need to know a bit more about your environment, like what type of machine do you have, are you using docker, if yes what type of docker image are you using, etc.
I will try to give you a generic answer and maybe we can discuss in detail your problem once you will be back.
Try to follow the commands as described in repo https://github.com/carsales/pyheif
brew install libffi libheif
In case that you are using docker then add the following packages into a RUN command
RUN apt-get install -y libffi-dev libheif-dev libde265-dev
Me and my friend are trying to create a simulator based on python so we wanted to use Box2D.
im trying to install box2d to python 3.6 using pip install Box2D but it shows me this -
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.
its not exectly an answer to my question but it might help someone
I try to install Box2D on python but I get the error log:
C:\>pip3 install Box2D
Collecting Box2D
Using cached https://files.pythonhosted.org/packages/cc/7b/ddb96fea1fa5b24f8929714ef483f64c33e9649e7aae066e5f5023ea426a/Box2D-2.3.2.tar.gz
Building wheels for collected packages: Box2D
Running setup.py bdist_wheel for Box2D ... error
Complete output from command c:\users\hp-laptop\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\HP-LAP~1\\AppData\\Local\\Temp\\pip-install-r48_7g5v\\Box2D\\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\HP-LAP~1\AppData\Local\Temp\pip-wheel-d2ghuwrx --python-tag cp36:
Using setuptools (version 40.5.0).
running bdist_wheel
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
C:\Users\HP-Laptop\AppData\Local\Programs\Python\Python36\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
C:\Users\HP-Laptop\AppData\Local\Programs\Python\Python36\Lib\pyprimtypes.swg(7) : Error: Syntax error in input(1).
error: command 'C:\\Users\\HP-Laptop\\AppData\\Local\\Programs\\Python\\Python36\\swig.exe' failed with exit status 1
----------------------------------------
Failed building wheel for Box2D
Running setup.py clean for Box2D
Failed to build Box2D
Installing collected packages: Box2D
Running setup.py install for Box2D ... error
Complete output from command c:\users\hp-laptop\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\HP-LAP~1\\AppData\\Local\\Temp\\pip-install-r48_7g5v\\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\HP-LAP~1\AppData\Local\Temp\pip-record-nv5dm4ru\install-record.txt --single-version-externally-managed --compile:
Using setuptools (version 40.5.0).
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
C:\Users\HP-Laptop\AppData\Local\Programs\Python\Python36\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
C:\Users\HP-Laptop\AppData\Local\Programs\Python\Python36\Lib\pyprimtypes.swg(7) : Error: Syntax error in input(1).
error: command 'C:\\Users\\HP-Laptop\\AppData\\Local\\Programs\\Python\\Python36\\swig.exe' failed with exit status 1
----------------------------------------
Command "c:\users\hp-laptop\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\HP-LAP~1\\AppData\\Local\\Temp\\pip-install-r48_7g5v\\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\HP-LAP~1\AppData\Local\Temp\pip-record-nv5dm4ru\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\HP-LAP~1\AppData\Local\Temp\pip-install-r48_7g5v\Box2D\
I tried all solutions for windows from Installing pocketsphinx python module: command 'swig.exe' failed without result.
How can I install Box2D and what means error code 1 by swig ?
I got the same error for Box2D, but solved as follows.
I am using Anaconda environment with python3.6.
try these.
conda install swig
pip install box2d
download swig here : http://www.swig.org/download.html
Extract the archive somewhere, add the path of the extracted directory to your PATH environment variable.
Restart your cmd console window (close it and reopen it), do your pip install Box2D
I need to say that when on the anaconda environment, just add path, it also doesn't work. we need to go on the Scripts with pip.exe. And run the command!
I got same error for Box2D.
My Solution-
downloading Microsoft Visual C++ Compiler for Python 2.7 from http://aka.ms/vcpython27
Complete the installation.
Then on anaconda prompt
type command 'pip install Box2D'
Then type 'pip install gym[all]'
This will install the remaining dependencies.
Hope this helps you.
Hello there I must be late but I hope this helps someone to solve his problem.
Just use any package manager like choco or conda or any other package manager to install the swig package to your machine then run the command to install box2d again.
choco install swig
pip install box2d-py
Whoever is on Windows and facing this issue. Try installing C++ tools on windows through https://visualstudio.microsoft.com/visual-cpp-build-tools/.
Then Install C++ tools through visual studio. This should solve your problem
Try Install Box2D after this (make sure Swig is installed)
Getting the following error after running
sudo pip install -U thefuck
Installing collected packages: psutil, decorator, six, pathlib, colorama, thefuck
Running setup.py install for psutil
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-G0ZOOD/psutil/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3F2Y2_-record/install-record.txt --single-version-externally-managed --compile:
cc: error trying to exec 'as': execvp: No such file or directory
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/psutil
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPSUTIL_VERSION=330 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o
gcc: error trying to exec 'as': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-G0ZOOD/psutil/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3F2Y2_-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-G0ZOOD/psutil
Also checked that I don't have /usr/bin/as file.
Tried installing binutils, doesn't work.
I have been trying to install pocketsphinx on my laptop. I have installed all the dependencies, still keep giving the below error. GCC.exe exits in a folder and is added to the environment variables. Appreciate all the help
Source in c:\users\archana\appdata\local\temp\pip_build_archana\pocketsphinx has version 0.0.4, which satisfies requirement pocketsphinx
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx
Running command C:\Users\ARCHANA\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\archana\\appdata\\local\\temp\\pip_build_ARCHANA\\pocketsphinx\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\archana\appdata\local\temp\pip-f_ai9e-record\install-record.txt --single-version-externally-managed --compile
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\sphinxbase
copying sphinxbase\swig\python\sphinxbase.py -> build\lib.win-amd64-2.7\sphinxbase
copying sphinxbase\swig\python\__init__.py -> build\lib.win-amd64-2.7\sphinxbase
creating build\lib.win-amd64-2.7\pocketsphinx
copying pocketsphinx\swig\python\pocketsphinx.py -> build\lib.win-amd64-2.7\pocketsphinx
copying pocketsphinx\swig\python\__init__.py -> build\lib.win-amd64-2.7\pocketsphinx
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging sphinxbase/swig/sphinxbase.i to sphinxbase/swig/sphinxbase_wrap.c
C:\Users\ARCHANA\Anaconda\swigwin-3.0.5\swig.exe -python -modern -Isphinxbase/include -Isphinxbase/include/sphinxbase -Isphinxbase/include/win32 -outdir sphinxbase/swig/python -o sphinxbase/swig/sphinxbase_wrap.c sphinxbase/swig/sphinxbase.i
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\sphinxbase
creating build\temp.win-amd64-2.7\Release\sphinxbase\src
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\lm
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\feat
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\util
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\fe
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxad
creating build\temp.win-amd64-2.7\Release\sphinxbase\swig
C:\Users\ARCHANA\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DHAVE_CONFIG_H -D_CRT_SECURE_NO_DEPRECATE -D_USRDLL -DSPHINXDLL -DWIN32 -D_WINDOWS -DYY_NO_UNISTD_H -Isphinxbase/include -Isphinxbase/include/sphinxbase -Isphinxbase/include/win32 -IC:\Users\ARCHANA\Anaconda\include -IC:\Users\ARCHANA\Anaconda\PC -c sphinxbase/src/libsphinxbase/lm\fsg_model.c -o build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\lm\fsg_model.o /wd4244 /wd4090 /wd4018
gcc.exe: error: /wd4244: No such file or directory
gcc.exe: error: /wd4090: No such file or directory
gcc.exe: error: /wd4018: No such file or directory
error: command 'gcc' failed with exit status 1
Complete output from command C:\Users\ARCHANA\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\archana\\appdata\\local\\temp\\pip_build_ARCHANA\\pocketsphinx\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\archana\appdata\local\temp\pip-f_ai9e-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\sphinxbase
copying sphinxbase\swig\python\sphinxbase.py -> build\lib.win-amd64-2.7\sphinxbase
copying sphinxbase\swig\python\__init__.py -> build\lib.win-amd64-2.7\sphinxbase
creating build\lib.win-amd64-2.7\pocketsphinx
copying pocketsphinx\swig\python\pocketsphinx.py -> build\lib.win-amd64-2.7\pocketsphinx
copying pocketsphinx\swig\python\__init__.py -> build\lib.win-amd64-2.7\pocketsphinx
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging sphinxbase/swig/sphinxbase.i to sphinxbase/swig/sphinxbase_wrap.c
C:\Users\ARCHANA\Anaconda\swigwin-3.0.5\swig.exe -python -modern -Isphinxbase/include -Isphinxbase/include/sphinxbase -Isphinxbase/include/win32 -outdir sphinxbase/swig/python -o sphinxbase/swig/sphinxbase_wrap.c sphinxbase/swig/sphinxbase.i
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\sphinxbase
creating build\temp.win-amd64-2.7\Release\sphinxbase\src
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\lm
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\feat
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\util
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\fe
creating build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxad
creating build\temp.win-amd64-2.7\Release\sphinxbase\swig
C:\Users\ARCHANA\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall -DSPHINXBASE_EXPORTS -DPOCKETSPHINX_EXPORTS -DHAVE_CONFIG_H -D_CRT_SECURE_NO_DEPRECATE -D_USRDLL -DSPHINXDLL -DWIN32 -D_WINDOWS -DYY_NO_UNISTD_H -Isphinxbase/include -Isphinxbase/include/sphinxbase -Isphinxbase/include/win32 -IC:\Users\ARCHANA\Anaconda\include -IC:\Users\ARCHANA\Anaconda\PC -c sphinxbase/src/libsphinxbase/lm\fsg_model.c -o build\temp.win-amd64-2.7\Release\sphinxbase\src\libsphinxbase\lm\fsg_model.o /wd4244 /wd4090 /wd4018
gcc.exe: error: /wd4244: No such file or directory
gcc.exe: error: /wd4090: No such file or directory
gcc.exe: error: /wd4018: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Removing temporary dir c:\users\archana\appdata\local\temp\pip_build_ARCHANA...
Command C:\Users\ARCHANA\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\archana\\appdata\\local\\temp\\pip_build_ARCHANA\\pocketsphinx\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\archana\appdata\local\temp\pip-f_ai9e-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\archana\appdata\local\temp\pip_build_ARCHANA\pocketsphinx
Exception information:
Traceback (most recent call last):
File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\commands\install.py", line 279, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\req.py", line 1380, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\req.py", line 699, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "C:\Users\ARCHANA\Anaconda\lib\site-packages\pip\util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command C:\Users\ARCHANA\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\archana\\appdata\\local\\temp\\pip_build_ARCHANA\\pocketsphinx\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\archana\appdata\local\temp\pip-f_ai9e-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\archana\appdata\local\temp\pip_build_ARCHANA\pocketsphinx
It seems you are using Anaconda python built with MinGW. The default pocketsphinx-python as mentioned in README is supposed to work with MSVC python (distributed from python.org), so it is not compatible with GCC python because it uses some MSVC-specific options in setup.py:
extra_compile_args.extend([
'/wd4244',
'/wd4267',
'/wd4197',
'/wd4090',
'/wd4018'
])
You have two choices:
Use default python for Windows which is compiled with MSVC
Remove that extra_compile_args from setup.py, then the package will probably build with MinGW gcc.
Christoph Gohlke kindly added a compiled version of pocketsphinx to his unofficial extension library.
If you are running Python 3.5 (32-bit) then download: "pocketsphinx-0.0.9-cp35-cp35m-win32.whl"
Here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx
Then run:
pip3 install "pocketsphinx-0.0.9-cp35-cp35m-win32.whl"