How to eliminate Error when installing web3.py - python

I am attempting to install web3 on my windows machine. I am using the Visual studio code terminal to do this. I have used both commands.
pip install web3
pip3 install web3
The first error I was getting was around the Visual studios build tools which I was able to install. Now when I run the command I get this error.
ERROR: Command errored out with exit status 1: 'C:\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ealvarado\\AppData\\Local\\Temp\\pip-install-nfyoy3t_\\cytoolz_9d52991e4515405886466c30cd8781ec\\setup.py'"'"'; __file__='"'"'C:\\Users\\ealvarado\\AppData\\Local\\Temp\\pip-install-nfyoy3t_\\cytoolz_9d52991e4515405886466c30cd8781ec\\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\ealvarado\AppData\Local\Temp\pip-record-g88od3fy\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python310\Include\cytoolz' Check the logs for full command output.
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: You are using pip version 21.2.3; however, version 21.3 is available.
You should consider upgrading via the 'C:\Python310\python.exe -m pip install --upgrade pip' command.

the WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages) is because at some point in time pip failed to delete some temporary folder that it make while updating or installing or something, to get rip of it just go to the folder listed and delete the folders which name start with ~.
The other warning is for you to upgrade your pip, you should do that.
And for the error, I don't know, maybe that library don't support python 3.10 yet and that is why it fail and/or your outdated pip don't fetch the most current version by virtue of being outdated

Related

pip metadata-generation-failed when i wanna to download demjson [duplicate]

version pip 21.2.4
python 3.6
The command:
pip install -r requirements.txt
The content of my requirements.txt:
mongoengine==0.19.1
numpy==1.16.2
pylint
pandas==1.1.5
fawkes
The command is failing with this error
ERROR: Command errored out with exit status 1:
command: /Users/*/Desktop/ml/*/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/setup.py'"'"'; __file__='"'"'/private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/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'"'"'))' egg_info --egg-base /private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-pip-egg-info-97994d6e
cwd: /private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/
Complete output (1 lines):
error in mongoengine setup command: use_2to3 is invalid.
----------------------------------------
WARNING: Discarding https://*/pypi/packages/mongoengine-0.19.1.tar.gz#md5=68e613009f6466239158821a102ac084 (from https://*/pypi/simple/mongoengine/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mongoengine==0.19.1 (from versions: 0.15.0, 0.19.1)
ERROR: No matching distribution found for mongoengine==0.19.1
It looks like setuptools>=58 breaks support for use_2to3:
setuptools changelog for v58
So you should update setuptools to setuptools<58 or avoid using packages with use_2to3 in the setup parameters.
I was having the same problem, pip==19.3.1
I install setuptools==58It worked for me. pip install setuptools==58. The error coming from setuptools==69 that previously run on my device. and Finally saved me setuptools version 58 for this error.
This worked for me.
pip install --upgrade pip setuptools==57.5.0
"pip install setuptools==58" worked for me. The setuptools version was 59 when I upgraded ubuntu to 22.04 and its python 3.10. I started a clean virtual environment for an existings django project. It had just two packages:
`pip list
Package Version
pip 22.0.2
setuptools 59.6.0`
Then I downgrade the setuptools to 58 as pip install setuptools==58.0.0. After that the pip install -r requirements.txt has not such error above.
Upgrading MongoEngine to >= 0.20 would also fix the problem as Python2 support (hence use_2to3) was dropped in 0.20
I'm working on Windows 11 and these solutions didn't work. I installed pybluez2 instead. Your python version >= 3.9 on Windows.
pip install pybluez2

Error while downloading the requirements using pip install (setup command: use_2to3 is invalid.)

version pip 21.2.4
python 3.6
The command:
pip install -r requirements.txt
The content of my requirements.txt:
mongoengine==0.19.1
numpy==1.16.2
pylint
pandas==1.1.5
fawkes
The command is failing with this error
ERROR: Command errored out with exit status 1:
command: /Users/*/Desktop/ml/*/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/setup.py'"'"'; __file__='"'"'/private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/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'"'"'))' egg_info --egg-base /private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-pip-egg-info-97994d6e
cwd: /private/var/folders/kn/0y92g7x55qs7c42tln4gwhtm0000gp/T/pip-install-soh30mel/mongoengine_89e68f8427244f1bb3215b22f77a619c/
Complete output (1 lines):
error in mongoengine setup command: use_2to3 is invalid.
----------------------------------------
WARNING: Discarding https://*/pypi/packages/mongoengine-0.19.1.tar.gz#md5=68e613009f6466239158821a102ac084 (from https://*/pypi/simple/mongoengine/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mongoengine==0.19.1 (from versions: 0.15.0, 0.19.1)
ERROR: No matching distribution found for mongoengine==0.19.1
It looks like setuptools>=58 breaks support for use_2to3:
setuptools changelog for v58
So you should update setuptools to setuptools<58 or avoid using packages with use_2to3 in the setup parameters.
I was having the same problem, pip==19.3.1
I install setuptools==58It worked for me. pip install setuptools==58. The error coming from setuptools==69 that previously run on my device. and Finally saved me setuptools version 58 for this error.
This worked for me.
pip install --upgrade pip setuptools==57.5.0
"pip install setuptools==58" worked for me. The setuptools version was 59 when I upgraded ubuntu to 22.04 and its python 3.10. I started a clean virtual environment for an existings django project. It had just two packages:
`pip list
Package Version
pip 22.0.2
setuptools 59.6.0`
Then I downgrade the setuptools to 58 as pip install setuptools==58.0.0. After that the pip install -r requirements.txt has not such error above.
Upgrading MongoEngine to >= 0.20 would also fix the problem as Python2 support (hence use_2to3) was dropped in 0.20
I'm working on Windows 11 and these solutions didn't work. I installed pybluez2 instead. Your python version >= 3.9 on Windows.
pip install pybluez2

How to fix could not find a version that satisfies the requirement django-multi-captcha-admin==1.0.0

I'm trying to set up a django project on my local. I've created a virtualenv. when I try install the requirements with:
pip install -r requirements.txt
I'm getting an error:
ERROR: Command errored out with exit status 1:
command: 'D:\Work\Web Development - Old\PullStream\django\evcs-fe\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lachi\\AppData\\Local\\Temp\\pip-install-847c5ux0\\django-multi-captcha-admin_1ab73ac1a6d14606bffcc9cca96b88bf\\setup.py'"'"';
__file__='"'"'C:\\Users\\lachi\\AppData\\Local\\Temp\\pip-install-847c5ux0\\django-multi-captcha-admin_1ab73ac1a6d14606bffcc9cca96b88bf\\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'"'"'))' egg_info --egg-base 'C:\Users\lachi\AppData\Local\Temp\pip-pip-egg-info-ocge_4v4'
cwd: C:\Users\lachi\AppData\Local\Temp\pip-install-847c5ux0\django-multi-captcha-admin_1ab73ac1a6d14606bffcc9cca96b88bf\
Complete output (2 lines):
error in django-multi-captcha-admin setup command: use_2to3 is invalid.
warning: pypandoc module not found, could not convert Markdown to RST
----------------------------------------
ERROR: Could not find a version that satisfies the requirement django-multi-captcha-admin==1.0.0 (from versions: 1.0.0)
ERROR: No matching distribution found for django-multi-captcha-admin==1.0.0
How can I fix this? any suggestions?
This issue tell you that pip repository can't find the (exact) version of the plugin you want install.
A workaround is too modify the requirements.txt file and take a more generic approach like this :
Instead of pip-plugin-name==version-number
do pip-plugin-name , this will install the most up to date version of this plugin hosted on pip server.
In your case : replace django-multi-captcha-admin==1.0.0 by django-multi-captcha-admin in the requirements.txt file.
If any version of this plugin is present on pip server, it will be installed.

Building wheels for collected packages: psycopg2

I am new to python. I am trying to execute my project but I am encountering some sort of error which is mentioned below while doing pip install -r requirements-local.txt
I created virtual environment using virtualenv -p python3 venv and activated it using source venv/bin/activate command. Then I try to install dependancy using pip install -r requirements-local.txt which throws error
Some part of the error :
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
and
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /Users/akshaysalekar/Documents/Projects/lambda-patch-ats/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/cy/cgz3qm196wg_h0wfdgh4clkr0000gn/T/pip-install-zss21x7x/psycopg2_0948f735c8ed42f6b38b42db053c4168/setup.py'"'"'; __file__='"'"'/private/var/folders/cy/cgz3qm196wg_h0wfdgh4clkr0000gn/T/pip-install-zss21x7x/psycopg2_0948f735c8ed42f6b38b42db053c4168/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 /private/var/folders/cy/cgz3qm196wg_h0wfdgh4clkr0000gn/T/pip-record-cmz8fx78/install-record.txt --single-version-externally-managed --compile --install-headers /Users/akshaysalekar/Documents/Projects/lambda-patch-ats/venv/include/site/python3.9/psycopg2
cwd: /private/var/folders/cy/cgz3qm196wg_h0wfdgh4clkr0000gn/T/pip-install-zss21x7x/psycopg2_0948f735c8ed42f6b38b42db053c4168/
Complete output (141 lines):```
I am using Macbook pro (macOS Big Sur). My python version is 3.9.6 , pip verison is pip 21.2.2.
My requirement file has only two dependencies which are
psycopg2==2.7.7
boto3==1.9.100
I have tried upgrading outdated package, Installing wheel package and reinstalling python and updating pip but no luck.
Can someone please help me in this.
Thank you
Edit : The complete error message is pasted here;
https://pastebin.com/raw/M9viR8fU

Unable to install Pandas Library using pip3

I try to install Pandas library uisg pip3 and get the following errors:
ERROR: Command errored out with exit status 1:
command: /Users/chaklader/PycharmProjects/OptimizingPublicTransport/producers/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/setup.py'"'"'; __file__='"'"'/private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/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 /private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-wheel-1lu27a0t
cwd: /private/var/folders/k4/q3psbyqj0l79b8ch527mr36h0000gp/T/pip-install-brdwlohn/pandas_7fb71e5a5c944478a4b18f60d65daa50/
Complete output (938 lines):
/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
^
/usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
14 warnings and 4 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pandas
Running setup.py clean for pandas
Failed to build pandas
Installing collected packages: pandas
Attempting uninstall: pandas
Whats the issue here and how to resolve it?
My guess is you're using a too high python version, see similar issues 1 2.
You can try python 3.6. You should always upgrade pip before installing packages.
And as you can see in the pip install log, it tries to compile from some C/C++ source, requiring the build tools which are sometimes unavailable.
So I suggest you use anaconda, from wiki:
Anaconda is a distribution of the Python and R programming languages
for scientific computing (data science, machine learning applications,
large-scale data processing, predictive analytics, etc.), that aims to
simplify package management and deployment.

Categories