deadsnakes / issues

Issues for https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
86 stars 6 forks source link

python3.12 -m pip install nonfunctional #276

Closed jgarvin closed 9 months ago

jgarvin commented 9 months ago

description

I installed the python3.12-full package. In past versions that was enough for me to then be able to do python3.12 -m pip install <PACKAGE>. The first issue I ran into was it complaining distutils was missing, but that was easy to fix, I installed the python3.12-distutils package. But then I get a new error, anytime I try to pip install, choice of package does not matter:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3/dist-packages/pip/__main__.py", line 16, in <module>
    from pip._internal.cli.main import main as _main  # isort:skip # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 27, in <module>
    from pip._internal.models.index import PyPI
  File "/usr/lib/python3/dist-packages/pip/_internal/models/index.py", line 1, in <module>
    from pip._vendor.six.moves.urllib import parse as urllib_parse
ModuleNotFoundError: No module named 'pip._vendor.six.moves'

I noticed it's referencing /usr/lib/python3 which is the official ubuntu python3 install, not what I want. So then I opened a Python 3.11 REPL and ran:

f"PYTHONPATH={':'.join(path.replace('11', '12') for path in sys.path)}"

I then tried running the pip install command again with this PYTHONPATH set in my environment, but I got the same error, as if something is hard coded to look at /usr/lib/python3.

os information

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:    20.04
Codename:   focal

uname -a

Linux eruv 5.18.12-051812-generic #202207150942 SMP PREEMPT_DYNAMIC Fri Jul 15 10:10:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
asottile commented 9 months ago

20.04 is probably too old for pip to with with python 3.12 -- I would recommend always using a virtualenv anyway