简体   繁体   English

Python 没有从 pip install 注册新模块

[英]Python isn't registering the new module from pip install

I recently installed the requests library for python.我最近为 python 安装了请求库。 And python does not see it, however it is installed Console output:而python没有看到它,但是它安装了控制台输出:

C:\Users\Raitis\Desktop>pip3 install requests
Requirement already satisfied: requests in c:\users\raitis\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (2.23.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\raitis\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests) (1.25.8)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\raitis\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests) (2019.11.28)
Requirement already satisfied: idna<3,>=2.5 in c:\users\raitis\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests) (2.9)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\users\raitis\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from requests) (3.0.4)

C:\Users\Raitis\Desktop>py
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'

It is installed indeed, and we can see that in direcory(Screenshot: https://prnt.sc/r90uhr ) and python's path is added to the enviroment PATH(Screenshot: https://prnt.sc/r90rus )确实安装了,我们可以看到在目录(截图: https ://prnt.sc/r90uhr)和python的路径添加到环境PATH(截图: https ://prnt.sc/r90rus)

Try installing the request library using this command instead尝试使用此命令安装请求

py -m pip install requests

Or in your case use,或者在您的情况下使用,

py -m pip3 install requests

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

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