且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Mac上导入Python模块时出现问题

更新时间:2022-10-31 12:47:32

问题可能是您没有安装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/