I have just upgraded 15.1 -> 15.2 and any pip3 command reports this error
andromeda:/home/fernando/tmp # pip3 install
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2725, in load_entry_point
return ep.load()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2343, in load
return self.resolve()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2349, in resolve
module = __import__(self.module_name, fromlist='__name__'], level=0)
File "/usr/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
ImportError: cannot import name 'FormatControl'
andromeda:/home/fernando/tmp #
I have tried to reinstal python3-pip but it did not work.
andromeda:/home/fernando/tmp # pip3 help install
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2725, in load_entry_point
return ep.load()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2343, in load
return self.resolve()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2349, in resolve
module = __import__(self.module_name, fromlist='__name__'], level=0)
File "/usr/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
ImportError: cannot import name 'FormatControl'
andromeda:/home/fernando/tmp #
There is definitely something wrong as the above help command should generate output but I have no idea what the problem is. I use Tumbleweed and pip3 has no issues.
Of course if you type pip3 install, you need to specify a package but it would say so and that is not the case here.
andromeda:/home/fernando/tmp # zypper in -f python3-pip
Retrieving repository 'home:lemmy04' metadata ..............................................................................................................................[done]
Building repository 'home:lemmy04' cache ...................................................................................................................................[done]
Loading repository data...
Reading installed packages...
Forcing installation of 'python3-pip-10.0.1-lp152.3.4.noarch' from repository 'openSUSE-Leap-15.2-Oss'.
Resolving package dependencies...
The following package is going to be reinstalled:
python3-pip
1 package to reinstall.
Overall download size: 1.6 MiB. Already cached: 0 B. No additional space will be used or freed after the operation.
Continue? [y/n/v/...? shows all options] (y):
Retrieving package python3-pip-10.0.1-lp152.3.4.noarch (1/1), 1.6 MiB ( 9.0 MiB unpacked)
Retrieving: python3-pip-10.0.1-lp152.3.4.noarch.rpm ..............................................................................................................[done (962 B/s)]
Checking for file conflicts: ...............................................................................................................................................[done]
(1/1) Installing: python3-pip-10.0.1-lp152.3.4.noarch ......................................................................................................................[done]
andromeda:/home/fernando/tmp # pip3 help install
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2725, in load_entry_point
return ep.load()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2343, in load
return self.resolve()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2349, in resolve
module = __import__(self.module_name, fromlist='__name__'], level=0)
File "/usr/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
ImportError: cannot import name 'FormatControl'
andromeda:/home/fernando/tmp #
test@andromeda:~> pip3 help install
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 473, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
return ep.load()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2447, in load
return self.resolve()
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2453, in resolve
module = __import__(self.module_name, fromlist='__name__'], level=0)
File "/usr/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
ImportError: cannot import name 'FormatControl'
test@andromeda:~>
I did an onlien upgrade with some repos activated: oss, non-oss, packman, and I think that mozilla.
Maybe I have to switch all packages to OSS and upgrade?
Hi
Are there any python packages installed from the other repositories? AFAIK, the command I indicated should have switched them all and used the leap 15.2 repositories to upgrade the packages from the respective repositories… Likewise I don’t generally add additional repositories, just grab the rpms I need and install via a local repository or direct with zypper.
Perhaps a good try at this point is to upgrade again.
Of course and always, backup anything that’s valuable. Nothing follows that should cause a serious problem like an unbootable system or loss of data, but don’t take a chance.
Option 1
Offline upgrade
Download the DVD and perform the upgrade.
Follow that up with an update to bring your system up to date.
Option 2
Online upgrade
Disable all repositories except for the OSS and OSS-update.
Execute another “zypper dup”
After verifying things are working properly, re-enable your other repos and perform a “zypper up” (not dup).
I encountered the same problem with pip3 on my system after upgrading from 15.1 to 15.2.
I think the problem was that at some time I upgraded pip by ‘pip install --upgrade pip’
so parts of a manually installed pip with version 20.* were still present in addition to leaps pip 10.*
In a reckless moment I removed all files with the pattern
/usr/lib/python3.6/site-packages/pip*
and force-reinstalled python3-pip with zypper. After this, pip3 worked again for me.
Glad to hear about your solution,
But I’ve never had a problem upgrading pip (so far) and upgrading is actually usually necessary to work correctly with the Pypi repos.
The OSS verion of pip has never been sufficiently up to date for me.
So I have just removed /usr/lib/python3.6/site-packages/pip*
And reinstalled python3-pip
andromeda:/usr/lib/python3.6/site-packages # zypper in --force python3-pip
Loading repository data...
Reading installed packages...
Forcing installation of 'python3-pip-10.0.1-lp152.3.4.noarch' from repository 'openSUSE-Leap-15.2-Oss'.
Resolving package dependencies...
The following package is going to be reinstalled:
python3-pip
1 package to reinstall.
Overall download size: 1.6 MiB. Already cached: 0 B. No additional space will be used or freed after the operation.
Continue? [y/n/v/...? shows all options] (y):
Retrieving package python3-pip-10.0.1-lp152.3.4.noarch (1/1), 1.6 MiB ( 9.0 MiB unpacked)
Retrieving: python3-pip-10.0.1-lp152.3.4.noarch.rpm ..........................................................................................................[done (962 B/s)]
Checking for file conflicts: ...........................................................................................................................................[done]
(1/1) Installing: python3-pip-10.0.1-lp152.3.4.noarch ..................................................................................................................[done]
andromeda:/usr/lib/python3.6/site-packages # ls /usr/lib/python3.6/site-packages/pip*
/usr/lib/python3.6/site-packages/pip:
__init__.py __main__.py __pycache__ _internal _vendor
/usr/lib/python3.6/site-packages/pip-10.0.1-py3.6.egg-info:
PKG-INFO SOURCES.txt dependency_links.txt entry_points.txt not-zip-safe requires.txt top_level.txt
andromeda:/usr/lib/python3.6/site-packages #
Now the error is gone
fernando@andromeda:~> pip3 help install
Usage:
pip3 install [options] <requirement specifier> [package-index-options] ...
pip3 install [options] -r <requirements file> [package-index-options] ...
pip3 install [options] -e] <vcs project url> ...
pip3 install [options] -e] <local project path> ...
pip3 install [options] <archive url/path> ...
Description:
Install packages from:
- PyPI (and other indexes) using requirement specifiers.
- VCS project urls.
- Local project directories.
- Local or remote source archives.
pip also supports installing from "requirements files", which provide
an easy way to specify a whole environment to be installed.
Install Options:
-r, --requirement <file> Install from the given requirements file. This option can be used multiple times.
.................
.................
Anyway I will review all the other issues all of you have said just in case they are causing any troubles.
I recently had this very same problem on 15.1 after a system update in 2020-10-7. deleting the directory and re installing did not succeed, I had to remove python3-pip=10.1.3.3 and then manually installing pip3 as explained in documentation. the relevant line in zypper history log from the update seems to be: