Error when installing the package numcodecs. What do I do? - python

I ran this command:
pip install numcodecs
And I got this error:
Error: Command errored out with exit status 1: 'c:\users\sunit\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sunit\\AppData\\Local\\Temp\\pip-install-419pmst9\\numcodecs\\setup.py'"'"'; __file__='"'"'C:\\Users\\sunit\\AppData\\Local\\Temp\\pip-install-419pmst9\\numcodecs\\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\sunit\AppData\Local\Temp\pip-record-5lw96050\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\sunit\appdata\local\programs\python\python38\Include\numcodecs' Check the logs for full command output.
What do I do?

I had the same error (trying to install zarr module, with the error coming from installing numcodecs). I was able to resolve it by updating my OSX to the newest version (Catalina), which then led to me reinstalling anaconda, Xcode, and previous Python packages from scratch. After doing that,
pip install numcodecs
still failed with the same error. However,
conda install numcodecs
or in my case:
conda install zarr
worked without error. It seems to have something to do with a conflict between Xcode tools and pip installer, which conda overcomes. My colleague was likewise unable to install via pip but could install via conda and a virtual environment on the first try, a faster option to try first before reinstalling everything.
Brief discussion of the issue on Github here.

Related

Pip doesn't install Twisted on Windows 10

I m trying to install binance api on windows 10 and get this error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\nikho\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\nikho\\AppData\\Local\\Temp\\pip-install-udog8jg5\\twisted_baf4607a0b15400dbdad7c4c4d71a93f\\setup.py'"'"'; __file__='"'"'C:\\Users\\nikho\\AppData\\Local\\Temp\\pip-install-udog8jg5\\twisted_baf4607a0b15400dbdad7c4c4d71a93f\\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\nikho\AppData\Local\Temp\pip-record-qxfi2_c7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\nikho\appdata\local\programs\python\python38\Include\Twisted'
And I saw this post Pip doesn't install Twisted on Windows. I tried it but doesnt work (also try to install 64bit version and 32bit version, my computer is 64)
Then I download from this site the last version: https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
I run it (doble click) and nothing happend, also I run in terminal like this and doesnt work:
pip install Twisted-19.2.1-cp37-cp37m-win_amd64.whl
Anyone knows how to fix it
Did you try :
pip install Twisted or pip install Twisted --user

Error with installing scrapy : exit 1 error

This is the error i get. it was working fine before, then i reinstalled python(i have added it to the system variables) and installed vscode if thats relevant.but even with windows terminal i get the same error. I did download the c++ with tools, followed the link and downloaded and installed it.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\chaitali\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Chaitali\\AppData\\Local\\Temp\\pip-install-3h22t0nk\\twisted\\setup.py'"'"'; __file__='"'"'C:\\Users\\Chaitali\\AppData\\Local\\Temp\\pip-install-3h22t0nk\\twisted\\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\Chaitali\AppData\Local\Temp\pip-record-ttosnncb\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\chaitali\appdata\local\programs\python\python39\Include\Twisted' Check the logs for full command output.
Try to install Twisted manually:
Download your version from this Python Extension Packages website and install it using (if you have Python 3.9 and win32 platform):
pip3 install Twisted‑20.3.0‑cp39‑cp39‑win32.whl
After that you'll be able to install Scrapy using:
pip3 install scrapy

Unable to pip install library with a specific version but able to do it without version

I tried to install numpy version 1.13.3 . I did pip install numpy==1.13.3 and it ran unsuccessfully.
Command errored out with exit status 1: 'c:\program files\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-0dci9ehe\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-0dci9ehe\\numpy\\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-dlf9c_63\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\User\AppData\Roaming\Python\Python38\Include\numpy'
I am using python 3.8.6. It is unsucesfull within any version <= 1.17 but succesfull with version 1.18 and 1.19 . I have also tried with others libraries like pandas==0.19.2 and it the same error occurs.
I do not really understand the error message and I suppose the problem is coming from my AppData folder any better understanding is welcome.
Try this:
File -> Settings -> nameOfProject -> Project Interpreter
then in the project interpreter it should show the current version you have in the left of the table and the latest version you can update it to on the right. Press on the package (in your case numpy) so the line across it goes blue then press the upgrade arrow to the right of the box (underneath the + and -) and it should update that way instead of manually.

pip install trains fails

upon running pip install trains in my virtual env
I am getting
ERROR: Command errored out with exit status 1:
command: /home/epdadmin/noam/code/venv_linux/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"'; __file__='"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lxz5t8pu/install-record.txt --single-version-externally-managed --compile --install-headers /home/epdadmin/noam/code/venv_linux/include/site/python3.8/retrying
cwd: /tmp/pip-install-owzh8lnl/retrying/
Complete output (10 lines):
running install
running build
running build_py
creating build
creating build/lib
copying retrying.py -> build/lib
running install_lib
copying build/lib/retrying.py -> /home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages
byte-compiling /home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages/retrying.py to retrying.cpython-38.pyc
error: [Errno 13] Permission denied: '/home/epdadmin/noam/code/venv_linux/lib/python3.8/site-packages/__pycache__/retrying.cpython-38.pyc.139678407381360'
----------------------------------------
ERROR: Command errored out with exit status 1: /home/epdadmin/noam/code/venv_linux/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"'; __file__='"'"'/tmp/pip-install-owzh8lnl/retrying/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lxz5t8pu/install-record.txt --single-version-externally-managed --compile --install-headers /home/epdadmin/noam/code/venv_linux/include/site/python3.8/retrying Check the logs for full command output.
I know that I am not supposed to run under sudo when using a venv, so I don't really understand the problem
running for example pip install pandas does work.
Python 3.8
How to install trains?
EDIT:
running pip install trains --user or pip install --user trains gives
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
You have two options:
Create a virtual environment and install your packages inside it (preferred)
Install your packages inside your user home directory by passing --user flag
pip install --user
The problem was a permissions problem for the venv.
Another problem was trains required some packages that were not yet available with wheels on Python3.8, so I had to downgrade Python to 3.7
That venv was created using Pycharm, and for some reason it was created with low permissions.
There was probably a way to elevate its permissions, but instead I just deleted it and created another one using command line by
python -m virtualenv --python=/usr/bin/python3.7 venv
And now pip install trains worked.
Very annoying.
I had the same error with installing matplotlib in Ubuntu 18.
Running these lines worked for me:
sudo apt-get install python3-dev
apt-get install build-essential
As found on setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Running setup.py install for httptools ... error

I was trying to install rasa in win10 but it always shows the error for httptools set-up
ERROR: Command errored out with exit status 1: 'c:\users\sandy\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sandy\\AppData\\Local\\Temp\\pip-install-5y1502t_\\httptools\\setup.py'"'"'; __file__='"'"'C:\\Users\\sandy\\AppData\\Local\\Temp\\pip-install-5y1502t_\\httptools\\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\sandy\AppData\Local\Temp\pip-record-dg9lglte\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I also faced the same issue in windows 10 and after research, i found its a python installation issue in windows 10.
steps to resolve the issue:
Please uninstall non-relavent python from windows 10.(else create python virtual environment).
Please install chocolatey in windows 10 using - https://chocolatey.org/docs/installation#installing-chocolatey link.
Open cmd as admin and run below with specific python version
choco install python3 --version 3.6.5
ref - https://chocolatey.org/packages/python3/3.6.5
Verify your environment variable have a new Python installation path.
open new cmd and type python and verify the version.
on cmd run - pip install rasa.
it's better to create a virtual environment and do development there and follow above steps.
Go to new folder and open cmd .
pip3 install -U pip virtualenv (folder name).
type - .\venv\Scripts\activate.
pip install --upgrade pip.
Source - https://www.tensorflow.org/install/pip

Categories

Resources