I have tried many suggestions online to install in my virtual env "torch" but to no avail. It won't let me import torch. I am able to install torchvision through conda though following this link: https://pytorch.org/get-started/locally/. Any suggestions are welcome!
Here is the error message (I downgrade to python 3.5 in the virtualenv)
(env_peem) PS E:\Users\Maggie\TS_MatSeg_Share> pip install torch
Collecting torch\Users\Maggie\TS_MatSeg_Share>
Using cached torch-0.1.2.post2.tar.gz (128 kB)
Requirement already satisfied: pyyaml in e:\users\maggie\ts_matseg_share\env_peem\lib\site-packages (from torch) (5.3.1)
Building wheels for collected packages: torch
Building wheel for torch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'E:\Users\Maggie\TS_MatSeg_Share\env_peem\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'E:\\Users\\Maggie\\AppData\\Local\\Temp\\7\\pip-install-80ts7bt9\\torch\\setup.py'"'"'; __file__='"'"'E:\\Users\\Maggie\\AppData\\Local\\Temp\\7\\pip-install-80ts7bt9\\torch\\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 'E:\Users\Maggie\AppData\Local\Temp\7\pip-wheel-xn9ld0bu'
cwd: E:\Users\Maggie\AppData\Local\Temp\7\pip-install-80ts7bt9\torch\
Complete output (30 lines):
running bdist_wheel
running build
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "E:\Users\Maggie\AppData\Local\Temp\7\pip-install-80ts7bt9\torch\setup.py", line 265, in <module>
description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
File "E:\Users\Maggie\TS_MatSeg_Share\env_peem\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "E:\Users\Maggie\TS_MatSeg_Share\env_peem\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
self.run_command('build')
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "E:\Users\Maggie\AppData\Local\Temp\7\pip-install-80ts7bt9\torch\setup.py", line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ImportError: No module named 'tools.nnwrap'
----------------------------------------
ERROR: Failed building wheel for torch
Running setup.py clean for torch
ERROR: Command errored out with exit status 1:
command: 'E:\Users\Maggie\TS_MatSeg_Share\env_peem\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'E:\\Users\\Maggie\\AppData\\Local\\Temp\\7\\pip-install-80ts7bt9\\torch\\setup.py'"'"'; __file__='"'"'E:\\Users\\Maggie\\AppData\\Local\\Temp\\7\\pip-install-80ts7bt9\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: E:\Users\Maggie\AppData\Local\Temp\7\pip-install-80ts7bt9\torch
Complete output (2 lines):
running clean
error: [Errno 2] No such file or directory: '.gitignore'
----------------------------------------
ERROR: Failed cleaning build dir for torch
Failed to build torch
Installing collected packages: torch
Running setup.py install for torch ... error
ERROR: Command errored out with exit status 1:
command: 'E:\Users\Maggie\TS_MatSeg_Share\env_peem\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'E:\\Users\\Maggie\\AppData\\Local\\Temp\\7\\pip-install-80ts7bt9\\torch\\setup.py'"'"'; __file__='"'"'E:\\Users\\Maggie\\AppData\\Local\\Temp\\7\\pip-install-80ts7bt9\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'E:\Users\Maggie\AppData\Local\Temp\7\pip-record-z6gt4ig9\install-record.txt' --single-version-externally-managed --compile --install-headers 'E:\Users\Maggie\TS_MatSeg_Share\env_peem\include\site\python3.5\torch'
cwd: E:\Users\Maggie\AppData\Local\Temp\7\pip-install-80ts7bt9\torch\
Complete output (23 lines):
running install
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "E:\Users\Maggie\AppData\Local\Temp\7\pip-install-80ts7bt9\torch\setup.py", line 265, in <module>
description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
File "E:\Users\Maggie\TS_MatSeg_Share\env_peem\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "E:\Users\Maggie\AppData\Local\Temp\7\pip-install-80ts7bt9\torch\setup.py", line 99, in run
self.run_command('build_deps')
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Maggie\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "E:\Users\Maggie\AppData\Local\Temp\7\pip-install-80ts7bt9\torch\setup.py", line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ImportError: No module named 'tools.nnwrap'
----------------------------------------
ERROR: Command errored out with exit status 1: 'E:\Users\Maggie\TS_MatSeg_Share\env_peem\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'E:\\Users\\Maggie\\AppData\\Local\\Temp\\7\\pip-install-80ts7bt9\\torch\\setup.py'"'"'; __file__='"'"'E:\\Users\\Maggie\\AppData\\Local\\Temp\\7\\pip-install-80ts7bt9\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'E:\Users\Maggie\AppData\Local\Temp\7\pip-record-z6gt4ig9\install-record.txt' --single-version-externally-managed --compile --install-headers 'E:\Users\Maggie\TS_MatSeg_Share\env_peem\include\site\python3.5\torch' Check the logs for full command output.
It tries to install torch-0.1.2.post2.tar.gz, which is an extremely outdated version, and it probably was more involved to install it back then. You don't want that version, but rather the most recent one, which currently is 1.5.0.
You didn't select the appropriate configuration from PyTorch - Getting Started Locally, because if you select Windows, which is the operating system you are using, the installation command is:
pip install torch===1.5.0 torchvision===0.6.0 -f https://download.pytorch.org/whl/torch_stable.html
That is because PyTorch does not publish the Windows versions to PyPI anymore, and it needs to be installed from their custom registry.
Another option to install is using conda and the pytorch channel. This basic installation will include torch.
conda create --name test python=3.5
conda install -c pytorch pytorch torchvision cpuonly
python
>>> import torch
Related
I have been trying to install flask via pip3 on my Mac, but I keep running into this error. I tried installing libffi through brew, and reinstalling python but still does not work.
ERROR: Command errored out with exit status 1:
command: /Users/prachimodi/Desktop/api/.venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zs/w0tb5f4d6dd_c098p_y7f5_r0000gn/T/pip-install-j9j3d44b/MarkupSafe/setup.py'"'"'; __file__='"'"'/private/var/folders/zs/w0tb5f4d6dd_c098p_y7f5_r0000gn/T/pip-install-j9j3d44b/MarkupSafe/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 /private/var/folders/zs/w0tb5f4d6dd_c098p_y7f5_r0000gn/T/pip-pip-egg-info-fb3uduhe
cwd: /private/var/folders/zs/w0tb5f4d6dd_c098p_y7f5_r0000gn/T/pip-install-j9j3d44b/MarkupSafe/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/prachimodi/Desktop/api/.venv/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
from setuptools.dist import Distribution
File "/Users/prachimodi/Desktop/api/.venv/lib/python3.7/site-packages/setuptools/dist.py", line 34, in <module>
from setuptools import windows_support
File "/Users/prachimodi/Desktop/api/.venv/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/Users/prachimodi/.pyenv/versions/3.7.9/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I'm having a problem to install the drun-airsim-client package (https://pypi.org/project/drun-airsim-client/). I am using a virtual environment and my python version is 3.8.10, my OS is Ubuntu 20.04. This is the log for the error.
ERROR: Command errored out with exit status 1:
command: '/home/USER/DRONE/venv/bin/python3' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e0459yt7/airsim/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e0459yt7/airsim/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 /tmp/pip-install-e0459yt7/airsim/pip-egg-info
cwd: /tmp/pip-install-e0459yt7/airsim/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-e0459yt7/airsim/setup.py", line 2, in <module>
from airsim import __version__
File "/tmp/pip-install-e0459yt7/airsim/airsim/__init__.py", line 1, in <module>
from .client import *
File "/tmp/pip-install-e0459yt7/airsim/airsim/client.py", line 3, in <module>
from .utils import *
File "/tmp/pip-install-e0459yt7/airsim/airsim/utils.py", line 1, in <module>
import numpy as np #pip install numpy
ModuleNotFoundError: No module named 'numpy'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can you please suggest me a solution, I have never faced this problem before with other packages & I have look for a solution but I still have the same error.
Thanks in advance.
It's a bug in airsim package: its setup.py imports airsim module and the module imports everything else. That is, setup.py imports all the dependencies before they are installed.
Please report the bug.
If you run !pip install msgpack-rpc-python before it should work
C:\Users\BISMILLAH>pip install submit50
Collecting submit50
Using cached submit50-3.0.2.tar.gz (5.5 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\bismillah\appdata\local\programs\python\python36-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\BISMILLAH\\AppData\\Local\\Temp\\pip-install-enj227ls\\submit50\\setup.py'"'"'; __file__='"'"'C:\\Users\\BISMILLAH\\AppData\\Local\\Temp\\pip-install-enj227ls\\submit50\\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 'C:\Users\BISMILLAH\AppData\Local\Temp\pip-install-enj227ls\submit50\pip-egg-info'
cwd: C:\Users\BISMILLAH\AppData\Local\Temp\pip-install-enj227ls\submit50\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\BISMILLAH\AppData\Local\Temp\pip-install-enj227ls\submit50\setup.py", line 2, in <module>
raise RuntimeError("submit50 does not support Windows directly. Instead, you should install the Windows Subsystem for Linux (https://learn.microsoft.com/en-us/windows/wsl/install-win10) and then install submit50 within that.")
RuntimeError: submit50 does not support Windows directly. Instead, you should install the Windows Subsystem for Linux (https://learn.microsoft.com/en-us/windows/wsl/install-win10) and then install submit50 within that.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Turns out submit50 doesn't run on Windows but this solution worked for me:
https://github.com/cs50/submit50/issues/196#issuecomment-617907204
I am trying to install lshash 0.0.4dev
with pip install lshash on anconda promot
and I get this error:
enter image description here
(base) C:\Users\User>python -m pip install lshash
Collecting lshash
Using cached lshash-0.0.4dev.tar.gz (7.2 kB)
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-xq8e0vo7\\lshash\\setup.py'"'"'; __file__='"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-xq8e0vo7\\lshash\\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 'C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\pip-egg-info'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\setup.py", line 3, in <module>
import lshash
File "C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\lshash\__init__.py", line 12, in <module>
from lshash import LSHash
ImportError: cannot import name 'LSHash' from 'lshash' (C:\Users\User\AppData\Local\Temp\pip-install-xq8e0vo7\lshash\lshash\__init__.py)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I hope someone can help me.
lshash 0.0.4dev was released on Apr 27, 2013. The project seems to be abandoned at the very early stage of development. The code is obviously Python2-only.
Try installing lshash3 instead
https://pypi.org/project/lshash3/
ERROR: Command errored out with exit status 1:
command: 'c:\users\sasa_\appdata\local\programs\python\python37-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sasa_\\AppData\\Local\
\Temp\\pip-install-dfyu35fv\\jws\\setup.py'"'"'; __file__='"'"'C:\\Users\\sasa_\\AppData\\Local\\Temp\\pip-install-dfyu35fv\\jws\\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 'C:\Users\sasa_\AppData
\Local\Temp\pip-install-dfyu35fv\jws\pip-egg-info'
cwd: C:\Users\sasa_\AppData\Local\Temp\pip-install-dfyu35fv\jws\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\sasa_\AppData\Local\Temp\pip-install-dfyu35fv\jws\setup.py", line 17, in <module>
long_description=read('README.md'),
File "C:\Users\sasa_\AppData\Local\Temp\pip-install-dfyu35fv\jws\setup.py", line 5, in read
return open(os.path.join(os.path.dirname(__file__), fname)).read()
UnicodeDecodeError: 'cp932' codec can't decode byte 0x93 in position 502: illegal multibyte sequence
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Tried with
pip install --upgrade setuptools
pip install pycryptodome
pip install shapely==1.4.1
Still cant