Bug 1767212

Summary: Updating to pip 19.3.x via pip breaks dnf installed pip
Product: [Fedora] Fedora Reporter: A Guin <a.guin003>
Component: python-pipAssignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 31CC: mdavid030, metherid, mhroncok, ncoghlan, pviktori, slavek.kabrda, tflink, TicoTimo, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/c7f39f1053da5f9ff4ce7faed59ec4a6c3b6b501
Whiteboard: abrt_hash:6526d4ee319fba2f4d5fab713ffc2457dbedfb8a;VARIANT_ID=workstation;
Fixed In Version: python-pip-19.0.3-4.fc30 python-pip-19.1.1-5.fc31 python-pip-18.1-2.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-19 01:15:07 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 Flags
File: backtrace
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description A Guin 2019-10-30 22:18:16 UTC
Description of problem:
I tried to pip3 install youtube-dl --user and was presented with this error. It came back with Traceback (most recent call last):
  File "/usr/bin/pip3", line 15, in <module>
    sys.exit(main())
TypeError: 'module' object is not callable

Version-Release number of selected component:
python3-pip-19.1.1-4.fc31

Additional info:
reporter:       libreport-2.10.1
cgroup:         0::/user.slice/user-1000.slice/user/gnome-terminal-server.service
cmdline:        /usr/bin/python3 /usr/bin/pip3 install youtube-dl --user
crash_function: module
exception_type: TypeError
executable:     /usr/bin/pip3
interpreter:    python3-3.7.4-5.fc31.x86_64
kernel:         5.3.7-301.fc31.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
pip3:15:<module>:TypeError: 'module' object is not callable

Traceback (most recent call last):
  File "/usr/bin/pip3", line 15, in <module>
    sys.exit(main())
TypeError: 'module' object is not callable

Local variables in innermost frame:
__name__: '__main__'
__doc__: None
__package__: None
__loader__: <_frozen_importlib_external.SourceFileLoader object at 0x7fb940dcb550>
__spec__: None
__annotations__: {}
__builtins__: <module 'builtins' (built-in)>
__file__: '/usr/bin/pip3'
__cached__: None
re: <module 're' from '/usr/lib64/python3.7/re.py'>
sys: <module 'sys' (built-in)>
main: <module 'pip._internal.main' from '/home/aiden/.local/lib/python3.7/site-packages/pip/_internal/main.py'>

Comment 1 A Guin 2019-10-30 22:18:21 UTC
Created attachment 1630825 [details]
File: backtrace

Comment 2 A Guin 2019-10-30 22:18:22 UTC
Created attachment 1630826 [details]
File: cpuinfo

Comment 3 A Guin 2019-10-30 22:18:24 UTC
Created attachment 1630827 [details]
File: environ

Comment 4 A Guin 2019-10-30 22:18:25 UTC
Created attachment 1630828 [details]
File: mountinfo

Comment 5 A Guin 2019-10-30 22:18:26 UTC
Created attachment 1630829 [details]
File: namespaces

Comment 6 A Guin 2019-10-30 22:18:27 UTC
Created attachment 1630830 [details]
File: open_fds

Comment 7 Miro Hrončok 2019-10-30 22:31:13 UTC
The new pip (19.3) has this:

  from pip._internal.main import main
  ...
  sys.exit(main())


Our pip has:


  try:
      from pip._internal import main
  except ImportError:
      # user has most probably downgraded pip in their home
      # so let them run it anyway until ~/.local/bin makes it in front of the PATH
      from pip import main
  ...
  sys.exit(main())



So we need to add another level of hack \o/

Amber, as a workaround, please use "python3 -m pip".

Comment 8 Miro Hrončok 2019-10-30 23:56:57 UTC
Rawhide fix proposed at: https://src.fedoraproject.org/rpms/python-pip/pull-request/42

This affects all Fedoras, but the stable ones are on older versions and will require backports once the rawhide one is reviewed.

We also plan to update rawhide to 19.3+, but I'd rather have this fixed first and only then rework the patch to work the other way around.

Comment 9 Miro Hrončok 2019-11-10 09:32:19 UTC
*** Bug 1770527 has been marked as a duplicate of this bug. ***

Comment 10 Miro Hrončok 2019-11-10 09:33:26 UTC
Another user reported this on Fedora 30.

I'll work on backporting this first thing on Monday.

Comment 12 Petr Viktorin (pviktori) 2019-11-12 14:45:34 UTC
Should we replace /usr/bin/pip with a script that calls `python -m pip $ARGS` in a subprocess?

Comment 13 Fedora Update System 2019-11-12 16:26:39 UTC
FEDORA-2019-1d18566497 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1d18566497

Comment 14 Fedora Update System 2019-11-13 10:47:03 UTC
python-pip-19.0.3-4.fc30 has been pushed to the Fedora 30 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-2019-1d18566497

Comment 15 Fedora Update System 2019-11-13 10:52:52 UTC
python-pip-19.1.1-5.fc31 has been pushed to the Fedora 31 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-2019-6d2a2381f2

Comment 16 Fedora Update System 2019-11-13 12:05:35 UTC
python-pip-18.1-2.fc29 has been pushed to the Fedora 29 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-2019-8d7fa47fd5

Comment 17 Fedora Update System 2019-11-19 01:15:07 UTC
python-pip-19.0.3-4.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2019-11-19 01:35:33 UTC
python-pip-19.1.1-5.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2019-11-23 02:01:55 UTC
python-pip-18.1-2.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.