最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】VSCode提示安装lint出错:Could not install packages due to an EnvironmentError Errno 13 Permission denied

VSCode crifan 7457浏览 0评论

VSCode打开了python代码,提示我去安装lint,就点击Install去安装了

结果:

<code>python -m pip install -U pylint
➜  naturling git:(master) ✗ python -m pip install -U pylint
Collecting pylint
  Downloading https://files.pythonhosted.org/packages/8b/62/b2c07085dd7bb4b7e8bb813873421692c1157191e87234550a1c39dff232/pylint-1.8.4-py2.py3-none-any.whl (690kB)
    100% |████████████████████████████████| 696kB 62kB/s
Requirement not upgraded as not directly required: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pylint) (1.4.1)
Collecting isort&gt;=4.2.5 (from pylint)
  Downloading https://files.pythonhosted.org/packages/41/d8/a945da414f2adc1d9e2f7d6e7445b27f2be42766879062a2e63616ad4199/isort-4.3.4-py2-none-any.whl (45kB)
    100% |████████████████████████████████| 51kB 75kB/s
Collecting astroid&lt;2.0,&gt;=1.6 (from pylint)
  Downloading https://files.pythonhosted.org/packages/f8/59/12a1d965bb99b595bfd72cc9a44863a0c00a2c05c38178f6139285bb00b5/astroid-1.6.3-py2.py3-none-any.whl (289kB)
    100% |████████████████████████████████| 296kB 45kB/s
Collecting singledispatch; python_version &lt; "3.4" (from pylint)
  Downloading https://files.pythonhosted.org/packages/c5/10/369f50bcd4621b263927b0a1519987a04383d4a98fb10438042ad410cf88/singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting mccabe (from pylint)
  Downloading https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting configparser; python_version == "2.7" (from pylint)
  Downloading https://files.pythonhosted.org/packages/7c/69/c2ce7e91c89dc073eb1aa74c0621c3eefbffe8216b3f9af9d3885265c01c/configparser-3.5.0.tar.gz
Collecting backports.functools-lru-cache; python_version == "2.7" (from pylint)
  Downloading https://files.pythonhosted.org/packages/03/8e/2424c0e65c4a066e28f539364deee49b6451f8fcd4f718fefa50cc3dcf48/backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Collecting futures (from isort&gt;=4.2.5-&gt;pylint)
  Downloading https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl
Collecting wrapt (from astroid&lt;2.0,&gt;=1.6-&gt;pylint)
  Downloading https://files.pythonhosted.org/packages/a0/47/66897906448185fcb77fc3c2b1bc20ed0ecca81a0f2f88eda3fc5a34fc3d/wrapt-1.10.11.tar.gz
Collecting enum34&gt;=1.1.3; python_version &lt; "3.4" (from astroid&lt;2.0,&gt;=1.6-&gt;pylint)
  Downloading https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Collecting lazy-object-proxy (from astroid&lt;2.0,&gt;=1.6-&gt;pylint)
  Downloading https://files.pythonhosted.org/packages/55/08/23c0753599bdec1aec273e322f277c4e875150325f565017f6280549f554/lazy-object-proxy-1.3.1.tar.gz
Building wheels for collected packages: configparser, wrapt, lazy-object-proxy
  Running setup.py bdist_wheel for configparser ... done
  Stored in directory: /Users/crifan/Library/Caches/pip/wheels/a3/61/79/424ef897a2f3b14684a7de5d89e8600b460b89663e6ce9d17c
  Running setup.py bdist_wheel for wrapt ... done
  Stored in directory: /Users/crifan/Library/Caches/pip/wheels/48/5d/04/22361a593e70d23b1f7746d932802efe1f0e523376a74f321e
  Running setup.py bdist_wheel for lazy-object-proxy ... done
  Stored in directory: /Users/crifan/Library/Caches/pip/wheels/a0/63/e2/6d93295282cb35b53b14b50b602c76dfb04471e21b31d8ad7b
Successfully built configparser wrapt lazy-object-proxy
pipenv 11.10.0 requires certifi, which is not installed.
pipenv 11.10.0 requires requests[security], which is not installed.
pipenv 11.10.0 requires virtualenv, which is not installed.
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
Installing collected packages: futures, isort, wrapt, enum34, lazy-object-proxy, singledispatch, backports.functools-lru-cache, astroid, mccabe, configparser, pylint
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/futures-3.2.0.dist-info'
Consider using the `--user` option or check the permissions.

➜  naturling git:(master) ✗
</code>

貌似是最近开发python的Flask期间,所安装的pipenv导致的?

加上–user试试

<code>
➜  naturling git:(master) ✗ python -m pip install -U pylint --user
Collecting pylint
  Using cached https://files.pythonhosted.org/packages/8b/62/b2c07085dd7bb4b7e8bb813873421692c1157191e87234550a1c39dff232/pylint-1.8.4-py2.py3-none-any.whl
Requirement not upgraded as not directly required: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pylint) (1.4.1)
Collecting isort&gt;=4.2.5 (from pylint)
  Using cached https://files.pythonhosted.org/packages/41/d8/a945da414f2adc1d9e2f7d6e7445b27f2be42766879062a2e63616ad4199/isort-4.3.4-py2-none-any.whl
Collecting astroid&lt;2.0,&gt;=1.6 (from pylint)
  Using cached https://files.pythonhosted.org/packages/f8/59/12a1d965bb99b595bfd72cc9a44863a0c00a2c05c38178f6139285bb00b5/astroid-1.6.3-py2.py3-none-any.whl
Collecting singledispatch; python_version &lt; "3.4" (from pylint)
  Using cached https://files.pythonhosted.org/packages/c5/10/369f50bcd4621b263927b0a1519987a04383d4a98fb10438042ad410cf88/singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting mccabe (from pylint)
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting configparser; python_version == "2.7" (from pylint)
Collecting backports.functools-lru-cache; python_version == "2.7" (from pylint)
  Using cached https://files.pythonhosted.org/packages/03/8e/2424c0e65c4a066e28f539364deee49b6451f8fcd4f718fefa50cc3dcf48/backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Collecting futures (from isort&gt;=4.2.5-&gt;pylint)
  Using cached https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl
Collecting wrapt (from astroid&lt;2.0,&gt;=1.6-&gt;pylint)
Collecting enum34&gt;=1.1.3; python_version &lt; "3.4" (from astroid&lt;2.0,&gt;=1.6-&gt;pylint)
  Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Collecting lazy-object-proxy (from astroid&lt;2.0,&gt;=1.6-&gt;pylint)
pipenv 11.10.0 requires certifi, which is not installed.
pipenv 11.10.0 requires requests[security], which is not installed.
pipenv 11.10.0 requires virtualenv, which is not installed.
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
Installing collected packages: futures, isort, wrapt, enum34, lazy-object-proxy, singledispatch, backports.functools-lru-cache, astroid, mccabe, configparser, pylint
Successfully installed astroid-1.6.3 backports.functools-lru-cache-1.5 configparser-3.5.0 enum34-1.1.6 futures-3.2.0 isort-4.3.4 lazy-object-proxy-1.3.1 mccabe-0.6.1 pylint-1.8.4 singledispatch-3.4.0.3 wrapt-1.10.11
</code>

好像可以了。

【总结】

此处VSCode中去安装Python代码的lint插件出错,解决办法是:

加上–user即可:

<code>python -m pip install -U pylint --user
</code>

转载请注明:在路上 » 【已解决】VSCode提示安装lint出错:Could not install packages due to an EnvironmentError Errno 13 Permission denied

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.148 seconds, using 22.15MB memory