asdf-python icon indicating copy to clipboard operation
asdf-python copied to clipboard

Unable to use pip with Python 3.10.2

Open bgs113 opened this issue 4 years ago • 3 comments

After upgrading to python latest (3.10.2), I cannot use pip. Instead, I receive the following error:

% pip --version
No preset version installed for command pip
Please install a version by running one of the following:

asdf install python 3.10.2

or add one of the following versions in your config file at /Users/<username>/.tool-versions
python 3.10.0
python 3.10.1
python 3.7.12
python 3.9.9

Python 3.10.2 is the current version set globally, and I confirmed pip is set up with this installation:

% asdf current python
python          3.10.2          /Users/<username>/.tool-versions

% python -m ensurepip
Looking in links: /var/folders/qn/yclk87390d32w5yqd9_wn9v00000gn/T/tmpergu57gj
Requirement already satisfied: setuptools in ./.asdf/installs/python/3.10.2/lib/python3.10/site-packages (58.1.0)
Requirement already satisfied: pip in ./.local/lib/python3.10/site-packages (21.3.1)

I attempted running asdf reshim python, and I also removed $HOME/.asdf/shims and ran asdf reshim, but this hasn't resolved the issue. Additionally, I have reproduced the problem across two machines, one Intel Mac running macOS Big Sur 11.6.2, and an Apple Silicon-based MacBook Pro running macOS Monterey 12.1. Reverting to 3.10.1 with asdf global python 3.10.1 allows pip to work as expected. Any thoughts on this problem?

bgs113 avatar Jan 18 '22 20:01 bgs113

same here, pip is just not available in 3.10.2:

❯ asdf shim-versions pip
python 2.7.17
python 3.8.1
python 3.8.0
python 3.7.7
python 3.9.7

according to python itself, it's there:

❯ asdf exec python3 -m ensurepip
Looking in links: /tmp/tmpjnfez1qa
Requirement already satisfied: setuptools in ./.asdf/installs/python/3.10.2/lib/python3.10/site-packages (58.1.0)
Requirement already satisfied: pip in ./.local/lib/python3.10/site-packages (22.0.3)

however, this works:

❯ asdf exec python3 -m pip install homeassistant-cli

lwille avatar Feb 26 '22 17:02 lwille

@bgs113 @lwille Did you solve it?

nyngwang avatar Mar 20 '23 11:03 nyngwang

It doesn't seem to be a problem in 3.11, so upgrading was my solution.

lwille avatar Mar 20 '23 12:03 lwille