简体   繁体   English

如何在Mac上安装python模块

[英]How to install python modules on mac

I'm a complete beginner in Python programming. 我是Python编程的完整入门者。 I have trouble installing/importing the module 'requests' on python. 我在python上安装/导入模块“请求”时遇到问题。 When I use my command terminal to install requests, I get a message that requests is already installed. 当我使用命令终端安装请求时,收到一条消息,请求已安装。 However, when I try to import requests into the file I'm working on, python tells me there is no such module installed. 但是,当我尝试将请求导入到我正在处理的文件中时,python告诉我没有安装这样的模块。

Sorry to bother you with this silly and probably easy question, thanks in advance! 抱歉,这个愚蠢的问题可能会打扰您,在此先感谢您!

If you use PyCharm (which is a great choice in my opinion), go to the tab Run and select Edit Configuration and in the window that just opened make sure the your Python interpreter is the one you used when you pip installed the package you asked about. 如果您使用PyCharm (我认为这是一个不错的选择),请转到“ 运行 ”选项卡,然后选择“ 编辑配置”,然后在刚刚打开的窗口中确保您的Python解释器是您pip安装要求的软件包时使用的解释器。关于。

You can check your Python version or just see in PyCharm if the requests is actually installed by going to the tab File , select Settings , click on Project: name_of_your_project and finally check in Project Interpreter that the package is installed. 您可以检查Python版本 ,也可以在PyCharm中查看是否确实安装了请求,方法是转到“ 文件 ”选项卡,选择“设置” ,单击“ 项目:name_of_your_project” ,最后在Project Interpreter中检查该软件包已安装。

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

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