Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pip and python verison
#1
I have small issues with pip and python versions

1. MY OS reports python version 2.7.12
2. My Eclipse lets me select FOUR "interpreter" versions - from 2.7 and including 3.8
3. OS reports pip version 20.2 , but keeps asking me to update from 8.1.1.
4. I am trying to add pyqt5 to python 3.8 and getting nowhere fast

5. I have an app build in 2,7, and want to keep it for a spell.


How do I tell OS to add PyQt5 to python3.8 packages - using CLI ?

Quote:root@z-desktop:/usr/lib# pip3 install pyqt5 python3.5
Collecting pyqt5
Using cached https://files.pythonhosted.org/packages/...5.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.5/tokenize.py", line 454, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-0emqqkyz/pyqt5/setup.py'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0emqqkyz/pyqt5/
You are using pip version 8.1.1, however version 20.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@z-desktop:/usr/lib#

pip --version
pip 20.2 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
root@z-desktop:/usr/lib# python --version
Python 2.7.12
root@z-desktop:/usr/lib#

FYI / SOLVED (?)


Quote:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qqkye_bn/PyQt5/
You are using pip version 8.1.1, however version 20.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@z-desktop:/usr/lib# pip install --upgrade pip
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/developmen...-2-support
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages (20.2)
root@z-desktop:/usr/lib# pip3 install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/...ne-any.whl (1.5MB)
100% |################################| 1.5MB 406kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.1
Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
Successfully installed pip-20.2
root@z-desktop:/usr/lib# pip --version
pip 20.2 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
root@z-desktop:/usr/lib# sudo apt install PyQt5
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package PyQt5
root@z-desktop:/usr/lib# sudo apt install pyqt5
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pyqt5
root@z-desktop:/usr/lib# sudo apt install pyqt
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pyqt
root@z-desktop:/usr/lib# pip3 install PyQt5
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Collecting PyQt5
Downloading PyQt5-5.15.0-5.15.0-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl (76.6 MB)
|################################| 76.6 MB 66 kB/s
Collecting PyQt5-sip<13,>=12.8
Downloading PyQt5_sip-12.8.0-cp35-cp35m-manylinux1_x86_64.whl (276 kB)
|################################| 276 kB 2.7 MB/s
Installing collected packages: PyQt5-sip, PyQt5
Successfully installed PyQt5-5.15.0 PyQt5-sip-12.8.0
root@z-desktop:/usr/lib# pip3 install PyBlueZ
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Requirement already satisfied: PyBlueZ in /usr/local/lib/python3.5/dist-packages (0.23)
root@z-desktop:/usr/lib#
Reply
#2
You could perhaps try
Output:
python3.8 -m pip install --user PyQt5
Reply
#3
Output:
z@z-desktop:~$ sudo python3.8 -m pip install --user PyQt5 [sudo] password for z: Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details return _get_module_details(pkg_main_name, error) File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details __import__(pkg_name) File "/usr/lib/python3/dist-packages/pip/__init__.py", line 14, in <module> from pip.utils import get_installed_distributions, get_prog File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 23, in <module> from pip.locations import ( File "/usr/lib/python3/dist-packages/pip/locations.py", line 9, in <module> from distutils import sysconfig ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py) z@z-desktop:~$
Reply
#4
If you are in Ubuntu, try
Output:
sudo apt install python3.8-distutils
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020