jingj 发表于 2020-7-26 21:32:28

win10 安装requests模块问题

1、cmd界面安装报错


pip install pipenv


Requirement already satisfied: pipenv in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (2020.6.2)
Requirement already satisfied: pip>=18.0 in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from pipenv) (20.1.1)
Requirement already satisfied: virtualenv-clone>=0.2.5 in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from pipenv) (0.5.4)
Requirement already satisfied: virtualenv in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from pipenv) (20.0.25)
Requirement already satisfied: certifi in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from pipenv) (2020.6.20)
Requirement already satisfied: setuptools>=36.2.1 in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from pipenv) (41.2.0)
Requirement already satisfied: six<2,>=1.9.0 in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from virtualenv->pipenv) (1.15.0)
Requirement already satisfied: distlib<1,>=0.3.0 in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from virtualenv->pipenv) (0.3.1)
Requirement already satisfied: filelock<4,>=3.0.0 in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from virtualenv->pipenv) (3.0.12)
Requirement already satisfied: appdirs<2,>=1.4.3 in c:\users\administrator\appdata\local\programs\python\python38-32\lib\site-packages (from virtualenv->pipenv) (1.4.4)

C:\Users\Administrator>$ pipenv install requests
'$' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

C:\Users\Administrator>pipenv install requests
Installing requests…
Adding requests to Pipfile's …
Installation Succeeded
Installing dependencies from Pipfile.lock (fbd99e)…
================================ 0/0 - 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.


2、pathon界面   输入requests后报错
import requests
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

曲速飞跃 发表于 2020-7-26 21:36:41

pip install requests pip install requests 试试

xxm8023 发表于 2020-7-26 21:55:55

pip install request-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
上面鱼油的方法不行的话,试试我的。
在cmd中输入回车即可

黑夜 发表于 2020-7-27 02:19:35

To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.


这里都说了,需要运行 pipenv shell ,虚拟环境才生效

hrp 发表于 2020-7-27 08:09:25

没必要安装虚拟环境工具pipenv吧?
直接pip install requests就可以了

陈尚涵 发表于 2020-7-27 08:55:51

pipenv只对虚拟环境生效。试试python -m pip install requests

jingj 发表于 2020-7-28 12:20:13

谢谢各位大佬
页: [1]
查看完整版本: win10 安装requests模块问题