首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在VSC中使用asdf找到pip包

无法在VSC中使用asdf找到pip包
EN

Stack Overflow用户
提问于 2021-03-03 23:54:36
回答 1查看 246关注 0票数 0

我刚刚安装了BigSur和Python的全新安装(使用asdf),在安装pip包时,它们似乎最终会出现在:

./.asdf/installs/python/3.9.2/lib/python3.9/site-packages

例如,当输入which flake8时,我会得到flake8 not found,但当我再次安装pip install flake8时,我会得到以下结果:

代码语言:javascript
复制
> 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似乎并没有让它变得更好。我使用的是最新的版本。

代码语言:javascript
复制
> 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)

这可能也会有帮助:

代码语言:javascript
复制
~
> which python
/Users/paul/.asdf/shims/python

~
> which pip
/Users/paul/.asdf/shims/pip

你知道怎样才能让which显示正确的路径,这样我就可以得到我的列表和格式了吗?

EN

回答 1

Stack Overflow用户

发布于 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,任何人都能回答

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66460522

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档