在Mac上导入Python模块时出现问题 [英] Problem with Python modules import on Mac

查看:73
本文介绍了在Mac上导入Python模块时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试尝试使用" pip install< module_name> "命令.但是我仍然不知道它是如何工作的.我只能使用 pygame 模块,该模块已通过 sudo easy_install 安装("pip install"无效).然后,我尝试安装另一个Eel模块,结果很奇怪.Eel模块显示在终端列表中 1 (我正在研究最新的Catalina)但是 python(在 Pycharm IDE 中)无法读取 eel 作为已安装的模块

I've tried tried to install several modules for Python with "pip install <module_name>" command. But I still cannot get how it works. I'am able to use only pygame module, which has been installed with sudo easy_install ("pip install" didn't work). Then I've tried to install another, Eel module and I have got strange results. The Eel module is shown in the Terminal list 1 (I'm working on the latest Catalina) but python (in Pycharm IDE) can't read eel as installed module 2.

我想,这是 python 或 pip 版本的问题(但 pypi 建议使用pip install"命令安装 Eel 模块 --

I suppose, it's sort of problem with python or pip versions (but pypi suggests to install the Eel module with "pip install" command -- https://pypi.org/project/Eel/)

我将非常感谢您的答复-)P.S.我已经检查过大小写和其他拼写内容=)我的意思是python的模块应命名为 e el,但正式命名为 E el(根据pypi页面上的命名 https://pypi.org/project/Eel/)

I'll be very grateful to get your answer -) P.S. I've checked cases and other spelling stuff=) I mean that module for python should be named eel but officially called Eel (according to the naming on the pypi page https://pypi.org/project/Eel/)

推荐答案

问题可能是您没有安装pip.

The issue might be that you don't have pip installed.

我知道大多数Mac电脑都已预先安装了pip和Python,但尝试以下操作也没有什么坏处: sudo easy_install pip

I know most Mac's have pip and Python pre-installed, but it wouldn't hurt to try: sudo easy_install pip

如果这似乎不是问题所在,则可能是在错误的目录中运行了 pip install packageName .

If this doesn't seem to be the issue, you might be running the pip install packageName in the wrong directory.

您将需要在python中访问您的scripts文件夹,然后在其中运行 pip install packageName 命令.这是可以帮助您访问该目录的资源: https://datatofish.com/install-package-python-using-pip/

You will need to access your scripts folder in python and run the pip install packageName command in there. Here is a resource which should help you reach that directory: https://datatofish.com/install-package-python-using-pip/

这篇关于在Mac上导入Python模块时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆