繁体   English   中英

由于环境错误,无法安装软件包:[Errno 2] 没有此类文件或目录

[英]Could not install packages due to an EnvironmentError: [Errno 2] No Such file or directory

这就是我用来安装软件包的方法,唯一有效的方法是 requests

pip._internal.main(['install', 'requests'])
pip._internal.main(['install', 'lxml'])
pip._internal.main(['install', 'cssselect'])
pip._internal.main(['install', 'selenium'])

这是我在控制台中收到的错误消息

Requirement already satisfied: requests in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (2.20.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (from requests) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (from requests) (2018.11.29)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (from requests) (1.24.1)
Requirement already satisfied: idna<2.8,>=2.5 in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (from requests) (2.7)
Collecting lxml
  Using cached https://files.pythonhosted.org/packages/43/c7/e088bf0f4f81e6b366cc2de12939c559b588b9525ad76215d122e69151ed/lxml-4.2.5-cp37-cp37m-win32.whl
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-tracker-047sxufq\\9dca403282533c33ca73fe9ecbdb1b605aeffa273ec0704ef517f834'

Collecting cssselect
  Using cached https://files.pythonhosted.org/packages/7b/44/25b7283e50585f0b4156960691d951b05d061abf4a714078393e51929b30/cssselect-1.0.3-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-tracker-047sxufq\\e5cecb9a9f004e9bd84aa92925e0dc6e8458127d14eb08f37c4e2d0f'

Collecting selenium
  Using cached https://files.pythonhosted.org/packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-tracker-047sxufq\\b3025a26893a7657747ef91c7e8a7d138021b8a645639c56cd0046c5'

我对python相当陌生,只是一般编码,我真的不知道这些错误是什么意思,我在谷歌上找不到任何我理解的东西,所以任何帮助都将不胜感激。

这是在visual studio代码和python 3.7.1上

我知道这来晚了,但我想这会帮助面临类似问题的其他人。

在路径中:

C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-tracker-047sxufq\\b3025a26893a7657747ef91c7e8a7d138021b8a645639c56cd0046c5

"AppData"文件夹及其内容可能被 Windows 标记为"Hidden"和/或"Read only" ,取消勾选这些并将它们指定为普通文件夹可能会有所帮助。

这是帮助我的唯一解决方案。 请尝试并发表评论。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM