Can you help me install 'torch' package? - installation

I am currently trying out a repository I found online. I started installing all packages required but couldn't get 'torch' to work. It always sais:
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
I tried different thing, such as:
pip3 install torch===1.3.1 torchvision===0.4.2 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.7.0 -f https://download.pytorch.org/whl/torch_stable.html
And like it's listed on their website. But always the same output...
I also tried:
pip install pytorch
But all i get is:
Collecting pytorch
Downloading pytorch-1.0.2.tar.gz (689 bytes)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pytorch
Building wheel for pytorch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jusp3\\AppData\\Local\\Temp\\pip-install-ya7jl_68\\pytorch_8bbc783dd4124cbfbe681831291bca86\\setup.py'"'"'; __file__='"'"'C:\\Users\\jus
p3\\AppData\\Local\\Temp\\pip-install-ya7jl_68\\pytorch_8bbc783dd4124cbfbe681831291bca86\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\jusp3\AppData\Local\Temp\pip-wheel-6xyrhi_f'
cwd: C:\Users\jusp3\AppData\Local\Temp\pip-install-ya7jl_68\pytorch_8bbc783dd4124cbfbe681831291bca86\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\jusp3\AppData\Local\Temp\pip-install-ya7jl_68\pytorch_8bbc783dd4124cbfbe681831291bca86\setup.py", line 15, in <module>
raise Exception(message)
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
----------------------------------------
ERROR: Failed building wheel for pytorch
Running setup.py clean for pytorch
Failed to build pytorch
Installing collected packages: pytorch
Running setup.py install for pytorch ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jusp3\\AppData\\Local\\Temp\\pip-install-ya7jl_68\\pytorch_8bbc783dd4124cbfbe681831291bca86\\setup.py'"'"'; __file__='"'"'C:\\Users\\j
usp3\\AppData\\Local\\Temp\\pip-install-ya7jl_68\\pytorch_8bbc783dd4124cbfbe681831291bca86\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\jusp3\AppData\Local\Temp\pip-record-bluie1pc\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\include\site\python3.11\pytorch'
cwd: C:\Users\jusp3\AppData\Local\Temp\pip-install-ya7jl_68\pytorch_8bbc783dd4124cbfbe681831291bca86\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\jusp3\AppData\Local\Temp\pip-install-ya7jl_68\pytorch_8bbc783dd4124cbfbe681831291bca86\setup.py", line 11, in <module>
raise Exception(message)
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jusp3\\AppData\\Local\\Temp\\pip-install-ya7jl_68\\pytorch_8bbc783dd4124cbfbe681831291bca86\\setup.py
'"'"'; __file__='"'"'C:\\Users\\jusp3\\AppData\\Local\\Temp\\pip-install-ya7jl_68\\pytorch_8bbc783dd4124cbfbe681831291bca86\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('
"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\jusp3\AppData\Local\Temp\pip-record-bluie1pc\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\include\site\python3.11\pytorch' Check the logs for full command output.
WARNING: You are using pip version 21.3.1; however, version 22.3.1 is available.
You should consider upgrading via the 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\Scripts\python.exe -m pip install --upgrade pip' command.
command: 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jusp3\\AppData\\Local\\Temp\\pip-install-uii0gp_r\\pytorch_7304807954de4167b1b57899aa1b5bf0\\setup.py'"'"'; __file__='"'"'C:\\Users\\jusp3\\AppData\\Local\\Temp\\pip-install-uii0gp_r\\pytorch_7304807954de4167b1b57899aa1b5bf0\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\jusp3\AppData\Local\Temp\pip-record-oz49ylit\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\include\site\python3.11\pytorch'
cwd: C:\Users\jusp3\AppData\Local\Temp\pip-install-uii0gp_r\pytorch_7304807954de4167b1b57899aa1b5bf0\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\jusp3\AppData\Local\Temp\pip-install-uii0gp_r\pytorch_7304807954de4167b1b57899aa1b5bf0\setup.py", line 11, in <module>
raise Exception(message)
Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jusp3\\AppData\\Local\\Temp\\pip-install-uii0gp_r\\pytorch_7304807954de4167b1b57899aa1b5bf0\\setup.py'"'"'; __file__='"'"'C:\\Users\\jusp3\\AppData\\Local\\Temp\\pip-install-uii0gp_r\\pytorch_7304807954de4167b1b57899aa1b5bf0\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\jusp3\AppData\Local\Temp\pip-record-oz49ylit\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\jusp3\OneDrive\Desktop\RedditVideoMakerBot-master\venv\include\site\python3.11\pytorch' Check the logs for full command output.
Any idea what's wrong?

Related

when i tried to use "pip install locust" command on Windows 10 error happened

ERROR: Command errored out with exit status 1:
command: 'd:\py\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Administrator\AppData\Local\Temp\pip-install-tf1pv8t2\Confi
gArgParse\setup.py'"'"'; file='"'"'C:\Users\Administrator\AppData\Local\Temp\pip-install-tf1pv8t2\ConfigArgParse\setup.py'"'"';f=getattr(tokenize, '"'"'
open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-i
nfo
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-tf1pv8t2\ConfigArgParse
Complete output (36 lines):
Traceback (most recent call last):
File "d:\py\lib\site-packages\pkg_resources_init_.py", line 2857, in get_entry_map
ep_map = self.ep_map
File "d:\py\lib\site-packages\pkg_resources_init.py", line 2815, in getattr
raise AttributeError(attr)
AttributeError: _ep_map

I cant install dlib using pip. what is the problem?

ERROR: Command errored out with exit status 1: command:
'C:\Users\dell\Anaconda3\python.exe' -u -c 'import sys, setuptools,
tokenize; sys.argv[0] =
'"'"'C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py'"'"';
file='"'"'C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\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\dell\AppData\Local\Temp\pip-wheel-nd2ljdx5'
--python-tag cp37
cwd: C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\ Complete
output (53 lines): running bdist_wheel running build running
build_py package init file 'dlib__init__.py' not found (or not a
regular file) running build_ext Traceback (most recent call last):
File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py",
line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "C:\Users\dell\Anaconda3\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "C:\Users\dell\Anaconda3\lib\subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\dell\Anaconda3\lib\subprocess.py", line 775, in init
restore_signals, start_new_session)
File "C:\Users\dell\Anaconda3\lib\subprocess.py", line 1178, in _execute_child
startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py",
line 261, in
'Topic :: Software Development',
File "C:\Users\dell\Anaconda3\lib\site-packages\setuptools__init__.py",
line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\dell\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dell\Anaconda3\lib\site-packages\wheel\bdist_wheel.py", line
192, in run
self.run_command('build')
File "C:\Users\dell\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dell\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\dell\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py",
line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py",
line 125, in get_cmake_version
"\n*******************************************************************\n") RuntimeError:
CMake must be installed to build the following extensions: dlib
ERROR: Failed building wheel for dlib Running setup.py clean for dlib Failed to build dlib Installing collected packages: dlib Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\dell\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py'"'"';
file='"'"'C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\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\dell\AppData\Local\Temp\pip-record-8fa9q7wn\install-record.txt'
--single-version-externally-managed --compile
cwd: C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\
Complete output (55 lines):
running install
running build
running build_py
package init file 'dlib__init__.py' not found (or not a regular file)
running build_ext
Traceback (most recent call last):
File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "C:\Users\dell\Anaconda3\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "C:\Users\dell\Anaconda3\lib\subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\dell\Anaconda3\lib\subprocess.py", line 775, in init
restore_signals, start_new_session)
File "C:\Users\dell\Anaconda3\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\dell\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\dell\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dell\Anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\dell\Anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\dell\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dell\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\dell\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dell\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py", line 125, in get_cmake_version
"\n*******************************************************************\n")
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\dell\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\setup.py'"'"'; file='"'"'C:\Users\dell\AppData\Local\Temp\pip-install-h7ictrqd\dlib\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\dell\AppData\Local\Temp\pip-record-8fa9q7wn\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
This is your error:
CMake must be installed to build the following extensions: dlib
Which tells it all. For the compilation to work, you need to install cmake.
But, since you are using anaconda, there is no reason to use pip to install dlib. It is actually not even recommended to use pip to install packages to your conda environment if it can be avoided. That said, simply use:
conda install -c conda-forge dlib
to install

Error while installing Box2D Python package for use with OpenAI Gym

I am trying to install OpenAI's Gym in Windows 10, according to this article.
I followed most of the steps without problems. However, at the step for installing Box2D with pip, I get the errors below. MyEnv is my current conda environment. How can I address this problem?
(MyEnv) C:\Users\me>pip 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
Building wheel for Box2D (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-v1w5reok\\Box2D\\setup.py'"'"'; __file__='"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-v1w5reok\\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\me\AppData\Local\Temp\pip-wheel-58bpeewu' --python-tag cp37
cwd: C:\Users\me\AppData\Local\Temp\pip-install-v1w5reok\Box2D\
Complete output (338 lines):
Using setuptools (version 41.2.0).
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
C:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\Library\bin\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
Box2D\Common\b2Math.h(67) : Warning 302: Identifier 'b2Vec2' redefined by %extend (ignored),
Box2D\Box2D_math.i(47) : Warning 302: %extend definition of 'b2Vec2'.
Box2D\Common\b2Math.h(158) : Warning 302: Identifier 'b2Vec3' redefined by %extend (ignored),
Box2D\Box2D_math.i(168) : Warning 302: %extend definition of 'b2Vec3'.
Box2D\Common\b2Math.h(197) : Warning 302: Identifier 'b2Mat22' redefined by %extend (ignored),
Box2D\Box2D_math.i(301) : Warning 302: %extend definition of 'b2Mat22'.
Box2D\Common\b2Math.h(271) : Warning 302: Identifier 'b2Mat33' redefined by %extend (ignored),
Box2D\Box2D_math.i(372) : Warning 302: %extend definition of 'b2Mat33'.
Box2D\Collision\b2DynamicTree.h(44) : Warning 312: Nested union not currently supported (ignored).
Box2D\Common\b2Settings.h(144) : Warning 506: Can't wrap varargs with keyword arguments enabled
Box2D\Common\b2Math.h(91) : Warning 509: Overloaded method b2Vec2::operator ()(int32) effectively ignored,
Box2D\Common\b2Math.h(85) : Warning 509: as it is shadowed by b2Vec2::operator ()(int32) const.
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\box2d
creating build\temp.win-amd64-3.7\Release\box2d\dynamics
creating build\temp.win-amd64-3.7\Release\box2d\dynamics\contacts
creating build\temp.win-amd64-3.7\Release\box2d\dynamics\joints
creating build\temp.win-amd64-3.7\Release\box2d\common
creating build\temp.win-amd64-3.7\Release\box2d\collision
creating build\temp.win-amd64-3.7\Release\box2d\collision\shapes
C:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\Library\mingw-w64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\include -IC:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\include -c Box2D\Box2D_wrap.cpp -o build\temp.win-amd64-3.7\Release\box2d\box2d_wrap.o -I.
Box2D\Box2D_wrap.cpp: In function 'bool b2CheckVertices(b2Vec2*, int32, bool)':
Box2D\Box2D_wrap.cpp:3760:16: warning: variable 'm_centroid' set but not used [-Wunused-but-set-variable]
b2Vec2 m_centroid = __b2ComputeCentroid(vertices, count);
^
Box2D\Box2D_wrap.cpp: In function 'long int b2ContactPoint___hash__(b2ContactPoint*)':
Box2D\Box2D_wrap.cpp:4181:77: error: cast from 'b2ContactPoint*' to 'long int' loses precision [-fpermissive]
SWIGINTERN long b2ContactPoint___hash__(b2ContactPoint *self){ return (long)self; }
^
Box2D\Box2D_wrap.cpp: In function 'long int b2AssertException___hash__(b2AssertException*)':
Box2D\Box2D_wrap.cpp:4205:83: error: cast from 'b2AssertException*' to 'long int' loses precision [-fpermissive]
SWIGINTERN long b2AssertException___hash__(b2AssertException *self){ return (long)self; }
<lots of errors from Box2D_wrap.cpp>
^
error: command 'C:\\Users\\me\\AppData\\Local\\Continuum\\anaconda3\\envs\\COBRA\\Library\\mingw-w64\\bin\\gcc.exe' failed with exit status 1
----------------------------------------
ERROR: 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
ERROR: Command errored out with exit status 1:
command: 'C:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-v1w5reok\\Box2D\\setup.py'"'"'; __file__='"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-v1w5reok\\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\me\AppData\Local\Temp\pip-record-7ni40amu\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\me\AppData\Local\Temp\pip-install-v1w5reok\Box2D\
Complete output (338 lines):
Using setuptools (version 41.2.0).
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
C:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\Library\bin\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
Box2D\Common\b2Math.h(67) : Warning 302: Identifier 'b2Vec2' redefined by %extend (ignored),
Box2D\Box2D_math.i(47) : Warning 302: %extend definition of 'b2Vec2'.
Box2D\Common\b2Math.h(158) : Warning 302: Identifier 'b2Vec3' redefined by %extend (ignored),
Box2D\Box2D_math.i(168) : Warning 302: %extend definition of 'b2Vec3'.
Box2D\Common\b2Math.h(197) : Warning 302: Identifier 'b2Mat22' redefined by %extend (ignored),
Box2D\Box2D_math.i(301) : Warning 302: %extend definition of 'b2Mat22'.
Box2D\Common\b2Math.h(271) : Warning 302: Identifier 'b2Mat33' redefined by %extend (ignored),
Box2D\Box2D_math.i(372) : Warning 302: %extend definition of 'b2Mat33'.
Box2D\Collision\b2DynamicTree.h(44) : Warning 312: Nested union not currently supported (ignored).
Box2D\Common\b2Settings.h(144) : Warning 506: Can't wrap varargs with keyword arguments enabled
Box2D\Common\b2Math.h(91) : Warning 509: Overloaded method b2Vec2::operator ()(int32) effectively ignored,
Box2D\Common\b2Math.h(85) : Warning 509: as it is shadowed by b2Vec2::operator ()(int32) const.
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\box2d
creating build\temp.win-amd64-3.7\Release\box2d\dynamics
creating build\temp.win-amd64-3.7\Release\box2d\dynamics\contacts
creating build\temp.win-amd64-3.7\Release\box2d\dynamics\joints
creating build\temp.win-amd64-3.7\Release\box2d\common
creating build\temp.win-amd64-3.7\Release\box2d\collision
creating build\temp.win-amd64-3.7\Release\box2d\collision\shapes
C:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\Library\mingw-w64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\include -IC:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\include -c Box2D\Box2D_wrap.cpp -o build\temp.win-amd64-3.7\Release\box2d\box2d_wrap.o -I.
Box2D\Box2D_wrap.cpp: In function 'bool b2CheckVertices(b2Vec2*, int32, bool)':
Box2D\Box2D_wrap.cpp:3760:16: warning: variable 'm_centroid' set but not used [-Wunused-but-set-variable]
b2Vec2 m_centroid = __b2ComputeCentroid(vertices, count);
^
<lots of errors from Box2D_wrap.cpp>
^
error: command 'C:\\Users\\me\\AppData\\Local\\Continuum\\anaconda3\\envs\\COBRA\\Library\\mingw-w64\\bin\\gcc.exe' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\me\AppData\Local\Continuum\anaconda3\envs\COBRA\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-v1w5reok\\Box2D\\setup.py'"'"'; __file__='"'"'C:\\Users\\me\\AppData\\Local\\Temp\\pip-install-v1w5reok\\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\me\AppData\Local\Temp\pip-record-7ni40amu\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
(MyEnv) C:\Users\me>

Pillow installation error on Yocto core-base-image

I am trying to install Pillow in Yocto core-base-image but when i use pip3 install Pillow i get the following error message:
Running setup.py install for Pillow ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/var/volatile/tmp/pip-install-n_gnb4rr/Pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/volatile/tmp/pip-record-1mienill/install-record.txt --single-version-externally-managed --compile:
.
.
.
File "/var/volatile/tmp/pip-install-n_gnb4rr/Pillow/setup.py", line 687, in build_extensions
raise RequiredDependencyException(f)
__main__.RequiredDependencyException: jpeg
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/var/volatile/tmp/pip-install-n_gnb4rr/Pillow/setup.py", line 903, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/var/volatile/tmp/pip-install-n_gnb4rr/Pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/volatile/tmp/pip-record-1mienill/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/volatile/tmp/pip-install-n_gnb4rr/Pillow/
I am including jpeg and libjpeg-turbo on loca.conf file as follows:
CONF_VERSION = "1"
MACHINE ?= "raspberrypi2"
INHERIT += "rm_work"
DL_DIR ?= "/home/<user>/poky-warrior-21.0.1/downloads"
CORE_IMAGE_EXTRA_INSTALL += " python3 python3-pip python3-dev git libjpeg-turbo jpeg libpng"
IMAGE_INSTALL_append = " opencv"
IMAGE_INSTALL_append = " cmake"
IMAGE_INSTALL_append = " nano"
IMAGE_INSTALL_append = " packagegroup-core-buildessential"
But its doesnt works, and here is my bblayers.conf file:
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/adrian/poky-warrior-21.0.1/meta \
/home/adrian/poky-warrior-21.0.1/meta-poky \
/home/adrian/poky-warrior-21.0.1/meta-yocto-bsp \
/home/adrian/poky-warrior-21.0.1/meta-raspberrypi \
/home/adrian/poky-warrior-21.0.1/meta-opencv \
/home/adrian/poky-warrior-21.0.1/meta-cmake \
/home/adrian/poky-warrior-21.0.1/meta-nano \
"

GDAL Virtualenv Python 3.6 Installation

I am having a brutal time getting gdal installed. I have a fresh install of Ubuntu Mint with a virtualenv Python 3.6 environment that I am trying to get GDAL installed on. After working through all the dependency requirements I now get the following error after running pip install gdal:
Collecting gdal
Using cached https://files.pythonhosted.org/packages/99/31/2e05c1be3196126fa04028aed51489f40ceea77e8361a80bc8b00fc463db/GDAL-2.3.1.tar.gz
Building wheels for collected packages: gdal
Running setup.py bdist_wheel for gdal ... error
Complete output from command /home/mnewman/pyenvs/py36/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sxbz7tcv/gdal/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 /tmp/tmp00t__5p7pip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying gdal.py -> build/lib.linux-x86_64-3.6
copying ogr.py -> build/lib.linux-x86_64-3.6
copying osr.py -> build/lib.linux-x86_64-3.6
copying gdalconst.py -> build/lib.linux-x86_64-3.6
copying gnm.py -> build/lib.linux-x86_64-3.6
copying gdalnumeric.py -> build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/__init__.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gnm.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/osr.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/ogr.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdal.py -> build/lib.linux-x86_64-3.6/osgeo
Fixing build/lib.linux-x86_64-3.6/gdal.py build/lib.linux-x86_64-3.6/ogr.py build/lib.linux-x86_64-3.6/osr.py build/lib.linux-x86_64-3.6/gdalconst.py build/lib.linux-x86_64-3.6/gnm.py build/lib.linux-x86_64-3.6/gdalnumeric.py build/lib.linux-x86_64-3.6/osgeo/gdal_array.py build/lib.linux-x86_64-3.6/osgeo/gdalconst.py build/lib.linux-x86_64-3.6/osgeo/__init__.py build/lib.linux-x86_64-3.6/osgeo/gnm.py build/lib.linux-x86_64-3.6/osgeo/osr.py build/lib.linux-x86_64-3.6/osgeo/ogr.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py build/lib.linux-x86_64-3.6/osgeo/gdal.py
Skipping optional fixer: ws_comma
Fixing build/lib.linux-x86_64-3.6/gdal.py build/lib.linux-x86_64-3.6/ogr.py build/lib.linux-x86_64-3.6/osr.py build/lib.linux-x86_64-3.6/gdalconst.py build/lib.linux-x86_64-3.6/gnm.py build/lib.linux-x86_64-3.6/gdalnumeric.py build/lib.linux-x86_64-3.6/osgeo/gdal_array.py build/lib.linux-x86_64-3.6/osgeo/gdalconst.py build/lib.linux-x86_64-3.6/osgeo/__init__.py build/lib.linux-x86_64-3.6/osgeo/gnm.py build/lib.linux-x86_64-3.6/osgeo/osr.py build/lib.linux-x86_64-3.6/osgeo/ogr.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py build/lib.linux-x86_64-3.6/osgeo/gdal.py
Skipping optional fixer: ws_comma
running build_ext
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-EKG1lX/python3.6-3.6.5=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/home/mnewman/pyenvs/py36/include -I/usr/include/python3.6m -I/home/mnewman/pyenvs/py36/lib/python3.6/site-packages/numpy/core/include -I/usr/include -c gdal_python_cxx11_test.cpp -o gdal_python_cxx11_test.o
building 'osgeo._gdal' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/extensions
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-EKG1lX/python3.6-3.6.5=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/home/mnewman/pyenvs/py36/include -I/usr/include/python3.6m -I/home/mnewman/pyenvs/py36/lib/python3.6/site-packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/gdal_wrap.o -I/usr/include/gdal
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
extensions/gdal_wrap.cpp: In function ‘retStringAndCPLFree* wrapper_VSIGetSignedURL(const char*, char**)’:
extensions/gdal_wrap.cpp:4067:12: error: ‘VSIGetSignedURL’ was not declared in this scope
return VSIGetSignedURL( utf8_path, options );
^~~~~~~~~~~~~~~
extensions/gdal_wrap.cpp:4067:12: note: suggested alternative: ‘VSIRewindL’
return VSIGetSignedURL( utf8_path, options );
^~~~~~~~~~~~~~~
VSIRewindL
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetErrorCounter(PyObject*, PyObject*)’:
extensions/gdal_wrap.cpp:7465:14: error: ‘CPLGetErrorCounter’ was not declared in this scope
result = CPLGetErrorCounter();
^~~~~~~~~~~~~~~~~~
extensions/gdal_wrap.cpp:7465:14: note: suggested alternative: ‘_wrap_GetErrorCounter’
result = CPLGetErrorCounter();
^~~~~~~~~~~~~~~~~~
_wrap_GetErrorCounter
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_MkdirRecursive(PyObject*, PyObject*)’:
extensions/gdal_wrap.cpp:8553:16: error: ‘VSIMkdirRecursive’ was not declared in this scope
result = VSIMkdirRecursive((char const *)arg1,arg2);
^~~~~~~~~~~~~~~~~
extensions/gdal_wrap.cpp:8553:16: note: suggested alternative: ‘VSIReadDirRecursive’
result = VSIMkdirRecursive((char const *)arg1,arg2);
^~~~~~~~~~~~~~~~~
VSIReadDirRecursive
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_RmdirRecursive(PyObject*, PyObject*)’:
extensions/gdal_wrap.cpp:8623:16: error: ‘VSIRmdirRecursive’ was not declared in this scope
result = VSIRmdirRecursive((char const *)arg1);
^~~~~~~~~~~~~~~~~
extensions/gdal_wrap.cpp:8623:16: note: suggested alternative: ‘VSIReadDirRecursive’
result = VSIRmdirRecursive((char const *)arg1);
^~~~~~~~~~~~~~~~~
VSIReadDirRecursive
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetActualURL(PyObject*, PyObject*)’:
extensions/gdal_wrap.cpp:8788:24: error: ‘VSIGetActualURL’ was not declared in this scope
result = (char *)VSIGetActualURL((char const *)arg1);
^~~~~~~~~~~~~~~
extensions/gdal_wrap.cpp:8788:24: note: suggested alternative: ‘_wrap_GetActualURL’
result = (char *)VSIGetActualURL((char const *)arg1);
^~~~~~~~~~~~~~~
_wrap_GetActualURL
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetFileSystemsPrefixes(PyObject*, PyObject*)’:
extensions/gdal_wrap.cpp:8962:25: error: ‘VSIGetFileSystemsPrefixes’ was not declared in this scope
result = (char **)VSIGetFileSystemsPrefixes();
^~~~~~~~~~~~~~~~~~~~~~~~~
extensions/gdal_wrap.cpp:8962:25: note: suggested alternative: ‘_wrap_GetFileSystemsPrefixes’
result = (char **)VSIGetFileSystemsPrefixes();
^~~~~~~~~~~~~~~~~~~~~~~~~
_wrap_GetFileSystemsPrefixes
extensions/gdal_wrap.cpp: In function ‘PyObject* _wrap_GetFileSystemOptions(PyObject*, PyObject*)’:
extensions/gdal_wrap.cpp:9026:24: error: ‘VSIGetFileSystemOptions’ was not declared in this scope
result = (char *)VSIGetFileSystemOptions((char const *)arg1);
^~~~~~~~~~~~~~~~~~~~~~~
extensions/gdal_wrap.cpp:9026:24: note: suggested alternative: ‘_wrap_GetFileSystemOptions’
result = (char *)VSIGetFileSystemOptions((char const *)arg1);
^~~~~~~~~~~~~~~~~~~~~~~
_wrap_GetFileSystemOptions
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for gdal
Running setup.py clean for gdal
Failed to build gdal
Not sure what I am missing here, I have installed all the libraries and -dev versions.
I solved it via:
install the newest version of gdal-bin and libgdal-dev:
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt upgrade
sudo apt install gdal-bin libgdal-dev
My gdal version was 2.2.3, so maybe specifically install that one if this does not work.
install using pip3:
pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`

Resources