我刚刚安装了BigSur和Python的全新安装(使用asdf),在安装pip包时,它们似乎最终会出现在:
./.asdf/installs/python/3.9.2/lib/python3.9/site-packages
例如,当输入which flake8时,我会得到flake8 not found,但当我再次安装pip install flake8时,我会得到以下结果:
> which flake8
flake8 not found
~
> pip install flake8
Requirement already satisfied: flake8 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (3.8.4)
Requirement already satisfied: pycodestyle<2.7.0,>=2.6.0a1 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (2.6.0)
Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (0.6.1)
Requirement already satisfied: pyflakes<2.3.0,>=2.2.0 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (2.2.0)我刚刚尝试使用我安装的请求,比如pip install requests,我在使用which时也没有找到,但我设法在VSC ok中使用了这个包。
我使用的是flake8和Black,我需要给VSC它们的路径。我用过
./.asdf/installs/python/3.9.2/lib/python3.9/site-packages/<package name>
但VSC似乎并没有让它变得更好。我使用的是最新的版本。
> python -V
Python 3.9.2
~
> pip -V
pip 21.0.1 from /Users/paul/.asdf/installs/python/3.9.2/lib/python3.9/site-packages/pip (python 3.9)这可能也会有帮助:
~
> which python
/Users/paul/.asdf/shims/python
~
> which pip
/Users/paul/.asdf/shims/pip你知道怎样才能让which显示正确的路径,这样我就可以得到我的列表和格式了吗?
发布于 2021-03-04 00:14:54
这解决了它。https://til.hashrocket.com/posts/ques11vrjs-get-pip-installed-executables-into-the-asdf-path
asdf reshim python
我很好奇为什么我要做this...if,任何人都能回答
https://stackoverflow.com/questions/66460522
复制相似问题