Secrets pip not downloading MacOS - python

the secrets library is not downloading when I try to install the pip. My python is updated to 3.11.0. Wondering if that may be the issue?
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [13 lines of output]
Traceback (most recent call last):
File "/private/var/folders/bb/30cx945s3g9ftgw4q18zyw900000gn/T/pip-install-ll7ks8fq/secrets_1a6d2e6558c34836a716331c20614163/setup.py", line 10, in <module>
import OpenSSL
ModuleNotFoundError: No module named 'OpenSSL'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/bb/30cx945s3g9ftgw4q18zyw900000gn/T/pip-install-ll7ks8fq/secrets_1a6d2e6558c34836a716331c20614163/setup.py", line 12, in <module>
raise ImportError('Installing this module requires OpenSSL python bindings')
ImportError: Installing this module requires OpenSSL python bindings
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
The last note leads me to believe that it is to do with the library itself.

A the error mentions: ImportError: Installing this module requires OpenSSL python bindings, you are probably missing OpenSSL bindings. They are part of the cryptography package.
Install them with pip install cryptography and try again.
EDIT: Python 3.11 is like a few days old. If it does not work you can also try to downscale to 3.10 or 3.9 as the packages is probably not supported yet in 3.11.

Related

ImportError: cannot import name 'build_py_2to3' from 'distutils.command.build_py'

I tried to install bipwallet through pip but it says there is no 'build_py_2to3' in distutils
Defaulting to user installation because normal site-packages is not writeable
Collecting bipwallet
...
Collecting protobuf==3.0.0a3
Using cached protobuf-3.0.0a3.tar.gz (88 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-q8v8yny3/protobuf_3f1a8b67130540ab9c93af7fe765918c/setup.py", line 29, in <module>
from distutils.command.build_py import build_py_2to3 as _build_py
ImportError: cannot import name 'build_py_2to3' from 'distutils.command.build_py' (/home/orkhan/.local/lib/python3.11/site-packages/setuptools/_distutils/command/build_py.py)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I tried to search in Google but it did not help. I also tried
pip install --upgrade distutils
thinking maybe it's just older version.
P.S. my python version 3.11
It seems as though bipwallet or one of its dependencies (protobuf-3.0.0a3?) wants to use whatever version of setuptools is available rather than pinning a specific version. setuptools v58.0.0 has a breaking change, first included in Python 3.10, where build_py_2to3 was removed.
You have a couple options:
Find the offending library and edit its setup.py to indicate that it should use setuptools<=57.5.0 and retry.
Downgrade your Python installation to 3.9 to get a local version of setuptools prior to the breaking change.
Here are a couple other related posts/links to the issue you're seeing:
https://github.com/mhammond/pywin32/issues/1813
https://bytemeta.vip/repo/StanfordVL/iGibson/issues/227
https://github.com/mobinmbn/bipwallet_fix

Unable to install top2vec

I'm trying to install top2vec for my topic analysis project. To install, I've used this command pip install top2vec. The installation process starts normally but it ends with this error:
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[8 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Asus\AppData\Local\Temp\pip-install-grwckgy_\numba_5149fd90a1d24717819bfa776cf85678\setup.py", line 51, in <module>
_guard_py_ver()
File "C:\Users\Asus\AppData\Local\Temp\pip-install-grwckgy_\numba_5149fd90a1d24717819bfa776cf85678\setup.py", line 48, in _guard_py_ver
raise RuntimeError(msg.format(cur_py, min_py, max_py))
RuntimeError: Cannot install on Python version 3.11.1; only versions >=3.7,<3.11 are supported.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
My pip version is: pip 22.3.1
The error your paste tell you everything:
File "C:\Users\Asus\AppData\Local\Temp\pip-install-grwckgy_\numba_5149fd90a1d24717819bfa776cf85678\setup.py", line 48, in _guard_py_ver
raise RuntimeError(msg.format(cur_py, min_py, max_py))
RuntimeError: Cannot install on Python version 3.11.1; only versions >=3.7,<3.11 are supported.
The root cause is when top2vec try to install its dependency numba, it said it can only support version >=3.7, <3.11, while your python version is 3.11.1.
See this and this:
We have not released numba and llvmlite for python3.11. The new python version is requiring massive changes to numba because of how numba is tightly coupled to Python’s bytecode internals.
The Python 3.11 support for the Numba project, for example, is still a work-in-progress as of Dec 8, 2022. Apparently it took them 6 months post-release until they had Python 3.9 support, and 3 months after 3.10.
So, you can monitor this official issue to see their update, or downgrade your python version.

Can't install python packages on my ubuntu virtual machine

This is the full script:
(venv) ubuntu#ubuntu:~$ pip install wxPython
Collecting wxPython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-jlwwpkvj/wxpython_66c7996a596740a4b92c4f3a3724336d/setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "/tmp/pip-install-jlwwpkvj/wxpython_66c7996a596740a4b92c4f3a3724336d/buildtools/config.py", line 30, in <module>
from attrdict import AttrDict
File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
from attrdict.mapping import AttrMap
File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(venv) ubuntu#ubuntu:~$
I think cause of the problem is virtuel machine. I can download packages on my host OS.
I am using UTM for ubuntu.
I try updating pip and setuptolls. I reinstalled differently ubuntu for multiple times.
I am searcing forums for weeks and still nothing.
You need to use an older version of Python (I am guessing 3.9). The best option is probably to set it up in virtualenv like this:
sudo apt update
sudo apt install python3.9
sudo apt-get install python3.9-dev python3.9-venv
python3.9 -m venv myenv
source venv/bin/activate
pip install wxPython
Try to download the wheel (*.whl) file for that package and then:
pip install <wheel file path>

No module named 'distutils.command.bdist_msi'

In Pycharm (Windows 11) I set up a basic project consisting of one line:
import pycurl
The environment is Virtualenv, the base intepreter path is C:\Users\strat\AppData\Local\Programs\Python311\python.exe
Of course, since the module is not installed, I get:
Traceback (most recent call last):
File "C:\Users\strat\PycharmProjects\pythonProject3\main.py", line 6, in <module>
import pycurl
ModuleNotFoundError: No module named 'pycurl'
Process finished with exit code 1
So I try to install it, the way I generally do in Linux:
pip install pycurl
but I get:
Collecting pycurl
Using cached pycurl-7.45.1.tar.gz (233 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\strat\AppData\Local\Temp\pip-install-7dqnopvz\pycurl_f564efcc68fa4b198200e92ae58e8c8b\setup.py", line 954, in <module>
setup_args['cmdclass'] = {'bdist_msi': get_bdist_msi_version_hack()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\strat\AppData\Local\Temp\pip-install-7dqnopvz\pycurl_f564efcc68fa4b198200e92ae58e8c8b\setup.py", line 594, in get_bdist_msi_version_hack
from distutils.command.bdist_msi import bdist_msi
ModuleNotFoundError: No module named 'distutils.command.bdist_msi'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
What's the origin of this error? As far as I understand they are about to remove distutils after its deprecation, but, as a simple user of a library, what can I do?
I had a similar problem. My solution was:
I downloaded and installed exe file: https://pypi.org/project/pycurl/7.43.0.5/#files
In my virtual environment in file pyvenv.cfg i set "include-system-site-packages = true"
Deactivate and again activate virtual environment.

Can't install Tensorflow, because of Metadata error

EDIT: I already upgraded pip before initializing this process
I'm kind of stuck at this part where you have to use Protobuf to install Tensorflow. I did everything as those instructors in the Youtube video. I saw multiple videos, documents but none could help me out. Please help me...
The codes which were given in the terminal are down below
sudo apt install protobuf
After this I cloned the Tensorflow/models from the github repository and then I typed these as shown in that video
git clone https://github.com/tensorflow/models
utkarsh#ubuntu:~/tensorflow/models/research$ protoc object_detection/protos/*.proto --python_out=.
Then I copied the setup.py into object_detection subfolder as per instructions
cp object_detection/packages/tf2/setup.py .
and finally I ran the setup.py
python -m pip install .
This was the error code I received, and now I'm stuck
utkarsh#ubuntu:~/tensorflow/models/research$ python -m pip install .
Processing /home/utkarsh/tensorflow/models/research
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 14, in <module>
File "/home/utkarsh/anaconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 18, in <module>
from setuptools.dist import Distribution
File "/home/utkarsh/anaconda3/lib/python3.7/site-packages/setuptools/dist.py", line 35, in <module>
from ._importlib import metadata
File "/home/utkarsh/anaconda3/lib/python3.7/site-packages/setuptools/_importlib.py", line 28, in <module>
disable_importlib_metadata_finder(metadata)
File "/home/utkarsh/anaconda3/lib/python3.7/site-packages/setuptools/_importlib.py", line 19, in disable_importlib_metadata_finder
for ob in sys.meta_path
File "/home/utkarsh/anaconda3/lib/python3.7/site-packages/setuptools/_importlib.py", line 20, in <listcomp>
if isinstance(ob, importlib_metadata.MetadataPathFinder)
AttributeError: module 'importlib_metadata' has no attribute 'MetadataPathFinder'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Any kind of help will be appreciated, Thank you!

Categories

Resources