I am updating PyGObject and give an error.
How should I update PyGObject
.....
Environment:
macOS Big Sur 11.5.2
python --version
Python 3.9.7
pip --version
pip 21.2.4 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
my operation.
ERROR: Cannot uninstall 'PyGObject'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
pip install --upgrade PyGObject
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: PyGObject in /usr/local/lib/python3.9/site-packages (3.40.1)
Collecting PyGObject
Using cached PyGObject-3.42.0-cp39-cp39-macosx_11_0_x86_64.whl
Requirement already satisfied: pycairo>=1.16.0 in /usr/local/lib/python3.9/site-packages (from PyGObject) (1.20.1)
Installing collected packages: PyGObject
Attempting uninstall: PyGObject
Found existing installation: PyGObject 3.40.1
ERROR: Cannot uninstall 'PyGObject'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Pip is unsure on the package dependencies to clean up in the upgrade. You can force the upgrade by telling it to ignore what is already installed.
pip install PyGObject --ignore-installed
Related
pip install google-cloud-bigquery
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/ec2-user/anaconda3/envs/python3/lib/python3.8/site-packages (from pyasn1-modules>=0.2.1->google-auth<3.0dev,>=1.25.0->google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-cloud-bigquery) (0.4.8)
Installing collected packages: pyasn1-modules, protobuf, grpcio, google-crc32c, cachetools, proto-plus, googleapis-common-protos, google-resumable-media, google-auth, grpcio-status, google-api-core, google-cloud-core, google-cloud-bigquery-storage, google-cloud-bigquery
Attempting uninstall: protobuf
Found existing installation: protobuf 3.19.1
Uninstalling protobuf-3.19.1:
Successfully uninstalled protobuf-3.19.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
sagemaker 2.117.0 requires protobuf<4.0,>=3.1, but you have protobuf 4.21.9 which is incompatible.
Successfully installed cachetools-5.2.0 google-api-core-2.10.2 google-auth-2.14.1 google-cloud-bigquery-3.4.0 google-cloud-bigquery-storage-2.16.2 google-cloud-core-2.3.2 google-crc32c-1.5.0 google-resumable-media-2.4.0 googleapis-common-protos-1.57.0 grpcio-1.51.0 grpcio-status-1.51.0 proto-plus-1.22.1 protobuf-4.21.9 pyasn1-modules-0.2.8
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the '/home/ec2-user/anaconda3/envs/python3/bin/python -m pip install --upgrade pip' command.
Note: you may need to restart the kernel to use updated packages.
ContextualVersionConflict: (protobuf 3.19.1 (/home/ec2-user/anaconda3/envs/python3/lib/python3.8/site-packages), Requirement.parse('protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5'), {'google-cloud-bigquery-storage'})
Try running pip install -U protobuf~=3.20.0 and then pip install google-cloud-bigquery.
Protobuf 4.x versions have some incompatibilities with other libraries.
Ref: How to downgrade protobuf
I am currently working on MAC and have created a new virtual environment for the project where i want to install the library - python-dotenv but getting below errors. To be noted that the python version on venv is Python 3.8.9. In this venv, i have 3 packages as of now -
pip 21.1.2
setuptools 57.0.0
wheel 0.36.2
Can someone please help with the below errors which i get after running the command pip install python-dotenv?
ERROR: Could not find a version that satisfies the requirement python-dotenv (from versions: none)
ERROR: No matching distribution found for python-dotenv
Try installing dotenv:
pip install dotenv
As per the docs and PEP425, I have created three pip wheels (one for each windows, linux and mac, with platform specific binaries).
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 27/11/2020 15:08 3099789 pyomexmeta-1.1.20-cp38-cp38-macosx_10_15_x86_64.whl
-a---- 27/11/2020 15:08 5128081 pyomexmeta-1.1.20-cp38-cp38-manylinux1_x86_64.whl
-a---- 27/11/2020 15:08 2682188 pyomexmeta-1.1.20-cp38-cp38-win_amd64.whl
Then I uploaded to pypi using
twine upload *
The linux version works perfectly:
pip install pyomexmeta==1.1.20
but when I try the same command on windows I get
(base) PS C:\x> pip install pyomexmeta==1.1.20
ERROR: Could not find a version that satisfies the requirement pyomexmeta==1.1.20 (from versions: 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.7, 1.1.8, 1.1.9, 1.1.10, 1.1.11, 1.1.12, 1.1.13, 1.1.14, 1.1.15, 1.1.16, 1.1.17)
ERROR: No matching distribution found for pyomexmeta==1.1.20
Looking at the pypi listing for my package shows me that the file I want is there yet it is not being downloaded. My only thought is that the platform tag must be wrong. However PEP425 says
The platform tag is simply distutils.util.get_platform() with all hyphens - and periods . replaced with underscore _.
so:
In [7]: from distutils import util
In [8]: util.get_platform()
Out[8]: 'win-amd64'
So why can I not download pyomexmeta-1.1.20 from pip?
Response to comments
(base) PS D:\bcftools> pip --version
pip 19.3.1 from C:\Miniconda\lib\site-packages\pip (python 3.7)
Updating pip is a good idea, but alas it does not help me here:
(base) PS D:\bcftools> C:\Miniconda\python.exe -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/cb/28/91f26bd088ce8e22169032100d4260614fc3da435025ff389ef1d396a433/pip-20.2.4-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.3.1
Uninstalling pip-19.3.1:
Successfully uninstalled pip-19.3.1
Successfully installed pip-20.2.4
(base) PS D:\bcftools> pip install pyomexmeta==1.1.20
ERROR: Could not find a version that satisfies the requirement pyomexmeta==1.1.20 (from versions: 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.7, 1.1.8, 1.1.9, 1.1.10, 1.1.11, 1.1.12, 1.1.13, 1.1.14, 1.1.15, 1.1.16, 1.1.17)
ERROR: No matching distribution found for pyomexmeta==1.1.20```
pip --version shows it's for Python 3.7. Your wheels are for Python 3.8. To install them you need pip from Python 3.8. Either
pip3.8 install pyomexmeta==1.1.20
or
python3.8 -m pip install pyomexmeta==1.1.20
PS. I must admit I don't know how to call this in Windows. Never used it.
PPS. From the #Doyousketch2 comment:
py -3.8 -m pip install pyomexmeta==1.1.20
In a docker I try to run pip install ortools and it can't be found. Other pip install packages work flawlessly. I use "FROM python:3.6.8-alpine" in my Dockerfile
bash-4.4# pip install ortools
Collecting ortools
ERROR: Could not find a version that satisfies the requirement ortools (from versions: none)
ERROR: No matching distribution found for ortools
bash-4.4# pip install --upgrade pip
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (19.1.1)
Root cause:
Gooogle OR tools does not support alpine, since pypi is not supported on alpine
Follow the progress of this issue: https://github.com/google/or-tools/issues/756
https://pypi.org/project/ortools/7.1.6722/#files it only has windows releases.
I switched from Alpine to Bullseye because I didn't have a constraint on it.
Note that this can increase image size.
"Python Xlib" ( http://pypi.python.org/pypi/Python%20Xlib ) is a low level python library for working with xlib. I have installed it on my Ubuntu Linux machine via apt, i.e. sudo aptitude install python-xlib. However is it possible to install it with pip in a virtualenv? I am writing a software package that uses xlib, and would like to be able to include an install_requires line in my setup.py.
Since the package is on PyPI (and appears in results of pip search xlib), I tried to pip install … the following package names but nothing worked: python\ xlib, python-xlib, Python Xlib, Python-Xlib, Python%20Xlib, but none worked.
`
Is it possible to install python xlib with pip?
sudo pip install svn+https://svn.code.sf.net/p/python-xlib/code/trunk/
Worked for me.
pip3 install python3-xlib
and
pip3 install python-xlib
When we run this command from the terminal, we can easily install it:
Collecting python3-xlib
Downloading https://files.pythonhosted.org/packages/ef/c6/2c5999de3bb1533521f1101e8fe56fd9c266732f4d48011c7c69b29d12ae/python3-xlib-0.15.tar.gz (132kB)
|████████████████████████████████| 133kB 1.3MB/s
Installing collected packages: python3-xlib
Running setup.py install for python3-xlib ... done
Successfully installed python3-xlib-0.15
GeorgeGentlys-Mac-mini:~ georgegently$ pip3 install python-xlib
Collecting python-xlib
Downloading https://files.pythonhosted.org/packages/f7/91/9f794491d1a8b810a9d4bb8fc9766a98354cb62bd6990685032b00f87001/python_xlib-0.25-py2.py3-none-any.whl (165kB)
|████████████████████████████████| 174kB 1.3MB/s
Collecting six>=1.10.0 (from python-xlib)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-xlib
Successfully installed python-xlib-0.25 six-1.12.0```