Bug 1569488
Summary: | [abrt] python3-pip: module(): pip3:7:<module>:ImportError: cannot import name 'main' | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | thilp | ||||||||||||||||
Component: | python-pip | Assignee: | Tomas Orsava <torsava> | ||||||||||||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||||||||
Severity: | unspecified | Docs Contact: | |||||||||||||||||
Priority: | unspecified | ||||||||||||||||||
Version: | 27 | CC: | bkabrda, cstratak, metherid, mhroncok, ncoghlan, socertis, SShehriyar266, tflink, TicoTimo, torsava | ||||||||||||||||
Target Milestone: | --- | ||||||||||||||||||
Target Release: | --- | ||||||||||||||||||
Hardware: | x86_64 | ||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||
URL: | https://retrace.fedoraproject.org/faf/reports/bthash/e9afcc73a400032e7843983eed88c47ceb8d8266 | ||||||||||||||||||
Whiteboard: | abrt_hash:bc47de74540b1f133cd6d189c51d352ecab99d8d;VARIANT_ID=workstation; | ||||||||||||||||||
Fixed In Version: | python-pip-9.0.3-2.fc28 python-pip-9.0.3-2.fc27 python-pip-9.0.3-2.fc26 | Doc Type: | If docs needed, set a value | ||||||||||||||||
Doc Text: | Story Points: | --- | |||||||||||||||||
Clone Of: | Environment: | ||||||||||||||||||
Last Closed: | 2018-04-19 13:52:31 UTC | Type: | --- | ||||||||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||||||||
Documentation: | --- | CRM: | |||||||||||||||||
Verified Versions: | Category: | --- | |||||||||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||||||
Embargoed: | |||||||||||||||||||
Attachments: |
|
Description
thilp
2018-04-19 11:43:16 UTC
Created attachment 1424020 [details]
File: backtrace
Created attachment 1424021 [details]
File: cgroup
Created attachment 1424022 [details]
File: cpuinfo
Created attachment 1424023 [details]
File: environ
Created attachment 1424024 [details]
File: mountinfo
Created attachment 1424025 [details]
File: namespaces
Created attachment 1424026 [details]
File: open_fds
Bugs like that are a common occurrence when updating pip with itself, as it replaces the system installed packages with the ones installed from pypi (and then rpm will not own the files) and pip doesn't play well will all systems and configs. Also pip 10 hides a lot of internals which were exposed with previous versions. I have worked on updating the package but there are various issues and I would prefer to wait until most of the issues are ironed out upstream. Please wait for the official package update from Fedora. When you install new version of pip (the way you did) it installs files inside your home directory. When you run pip3, it runs /usr/bin/pip3 and that is from the Fedora package. It expects pip module to have some interface (i.e. it contains "main" to import), yet your pip from home is newer and it doesn't have "main" and it fails. There is nothing we can do from that in Fedora. Here are some tips: * check whether pip installs ~/.local/bin/pip3 or only ~/.local/bin/pip * check if ~/.local/bin is in your path * always invoke pip with "python3 -m pip" * run "python3 -Ei -m pip" to run the system pip Similar problem has been detected: It appeared using both pip and pip3 I ran pip install --upgrade pip --user pip3 install --upgrade pip --user This caused the problem. reporter: libreport-2.9.3 cmdline: /usr/bin/python3 /usr/bin/pip3 crash_function: module exception_type: ImportError executable: /usr/bin/pip3 kernel: 4.15.17-300.fc27.x86_64 package: python3-pip-9.0.3-1.fc27 reason: pip3:7:<module>:ImportError: cannot import name 'main' runlevel: N 5 type: Python3 uid: 1000 Hey, Muhammad! That seems odd, installing with --user shouldn't break things like that. Have you before that used pip(3) with sudo, perhaps? Could you please run these two commands and report back? $ rpm -V python2-pip $ rpm -V python3-pip Similar problem has been detected: tried to run pip3 after failing to upgrade pip many times and finally reinstalling it via dnf error when I tried to upgrade from 9.0.3 to 10.0.1 pip3 install --upgrade pip Collecting pip Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl Installing collected packages: pip Found existing installation: pip 9.0.3 Uninstalling pip-9.0.3: Exception: Traceback (most recent call last): File "/usr/lib64/python3.6/shutil.py", line 544, in move os.rename(src, real_dst) OSError: [Errno 18] Invalid cross-device link: '/usr/bin/pip3' -> '/tmp/pip-vnlj0f9t-uninstall/usr/bin/pip3' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/lib/python3.6/site-packages/pip/commands/install.py", line 365, in run strip_file_prefix=options.strip_file_prefix, File "/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 778, in install requirement.uninstall(auto_confirm=True) File "/usr/lib/python3.6/site-packages/pip/req/req_install.py", line 754, in uninstall paths_to_remove.remove(auto_confirm) File "/usr/lib/python3.6/site-packages/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 267, in renames shutil.move(old, new) File "/usr/lib64/python3.6/shutil.py", line 559, in move os.unlink(src) PermissionError: [Errno 13] Permission denied: '/usr/bin/pip3' You are using pip version 9.0.3, however version 10.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. reporter: libreport-2.9.3 cmdline: /usr/bin/python3 /usr/bin/pip3 crash_function: module exception_type: ImportError executable: /usr/bin/pip3 kernel: 4.15.17-300.fc27.x86_64 package: python3-pip-9.0.3-1.fc27 reason: pip3:7:<module>:ImportError: cannot import name 'main' runlevel: N 5 type: Python3 uid: 1000 > pip3 install --upgrade pip
this cannot work by deign.
Please, use venv, or --user. If you use --user, run pip with `python3 -m pip` to avoid the originally reported problem.
System-wide pip is not intended to be upgraded this way? So it's just updated by the package manager? Exactly. (In reply to Miro Hrončok from comment #15) > Exactly. Thank you for responding to my question and volunteering your time to contribute to pip. However, the behavior of pip gave me no indication that running "pip install --upgrade pip" cannot work by design. In fact, when installing livestreamer systemwide, pip told me to run "pip install --upgrade pip". If this cannot work, why doesn't pip tell me to run "pip install --user --upgrade pip"? Good point. Opened as https://bugzilla.redhat.com/show_bug.cgi?id=1573755 Thanks Miro *** This bug has been marked as a duplicate of bug 1571650 *** python-pip-9.0.3-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-7146cb4e7f python-pip-9.0.3-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-7146cb4e7f python-pip-9.0.3-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b795b92cc0 python-pip-9.0.3-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-fcbef2ab8c python-pip-9.0.3-2.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b795b92cc0 python-pip-9.0.3-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-fcbef2ab8c python-pip-9.0.3-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report. python-pip-9.0.3-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report. python-pip-9.0.3-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report. *** Bug 1630830 has been marked as a duplicate of this bug. *** |