【发布时间】:2019-05-03 14:46:57
【问题描述】:
这是我用来安装软件包的,唯一有效的是请求
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 上
【问题讨论】:
-
我完全没有理由使用
pip._internal.main(['install', 'requests']和其他的。打开 cmd 提示符并输入pip install <library name here>。如果您是 python 新手,很奇怪您发现了您正在使用的这种边缘方法;您对标准方法有疑问吗? -
@roganjosh 当我使用命令提示符时,它说 pip 无法识别,所以我只是用谷歌搜索了一堆东西,我发现它适用于请求,但不适用于其他东西,我想要能够轻松地在多台计算机上使用它,这是我找到的最好方法。
-
好的,这不是正确的解决方法。你安装的是 Anaconda 还是普通的 python?
-
@roganjosh 只是普通的 python
标签: python pip installation