简体   繁体   English

无法从 pip 安装包

[英]Unable to install package from pip

I have tried to install Requests like this:我试图安装这样的请求:

python3 -m install requests

but it's not working.但它不起作用。

在这个链接有一个链接

You are using pip incorrectly.您使用 pip 不正确。 You should run pip command from the command line, not in Python:您应该从命令行运行pip命令,而不是在 Python 中:

C:\Windows\system32> python3 -m pip install requests
C:\Windows\system32> python3
Python 3.6.1........
>>> import requests

Read pip documentation carefully.仔细阅读pip 文档

Yes, if it is in python, it will give a syntax error.是的,如果是在python中,它会给出语法错误。 Try it right when you open up the cmd.打开cmd就试试吧。

In this link, I am in python:在这个链接中,我在 python 中:

But in the command prompt, it works:但是在命令提示符下,它可以工作:

Well, as for me, I have it already installed in Spyder.好吧,至于我,我已经在 Spyder 中安装了它。

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

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