简体   繁体   English

无法在Mac上点子安装python模块

[英]Unable to pip install python modules on mac

My friend is trying to install pygame on its mac, when it he tries to install any python module he gets an error saying: 我的朋友尝试在Mac上安装pygame,当他尝试安装任何python模块时,他收到一条错误消息:

ImportError: No module named pkg_resources,

There is no pkg_resources folder in his local/bin, we have tried multiple times to uninstall and reinstall python but nothing seems to be working, Thanks in advance for your help. 他的local / bin中没有pkg_resources文件夹,我们已尝试多次卸载并重新安装python,但似乎无济于事,在此先感谢您的帮助。

Can you please provide more details(like what was the method employed to install the module along with python version etc, whatever would be relevant for debugging), so that it would be easy for debugging? 您能否提供更多详细信息(例如与python版本等一起安装模块所采用的方法是什么,与调试有关的任何内容),以便于调试?

Try these 2 steps, 试试这两个步骤,

  1. pip install setuptools pip install setuptools

  2. if you have no setuptools installed then - follow this link to install the same. 如果您没有安装setuptools,则-按照此链接进行安装。

Also, check this answer and follow. 另外,请检查此答案并遵循。

pygame is getting installed successfully on macos for me, pygame已成功在macOS上安装,

(sof) 07:06 PM##~::>pip list
Package    Version
---------- -------------------
certifi    2019.9.11
pip        19.3.1
setuptools 41.6.0.post20191030
wheel      0.33.6
(sof) 07:34 PM##~::>pip install pygame
Collecting pygame
  Downloading https://files.pythonhosted.org/packages/32/37/453bbb62f90feff2a2b75fc739b674319f5f6a8789d5d21c6d2d7d42face/pygame-1.9.6-cp37-cp37m-macosx_10_11_intel.whl (4.9MB)
     |████████████████████████████████| 4.9MB 7.7MB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.6
(sof) 07:34 PM##~::>pip list
Package    Version
---------- -------------------
certifi    2019.9.11
pip        19.3.1
pygame     1.9.6
setuptools 41.6.0.post20191030
wheel      0.33.6
(sof) 07:34 PM##~::>python -V
Python 3.7.5

this is the error I receive when trying to pip install anything 这是我尝试点子安装任何东西时收到的错误

pip install setuptoos Traceback (most recent call last): File "/usr/local/bin/pip", line 6, in from pkg_resources import load_entry_point ImportError: No module named pkg_resources pip install setuptoos回溯(最近一次调用):文件“ / usr / local / bin / pip”,第6行,来自pkg_resources import load_entry_point ImportError:没有名为pkg_resources的模块

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

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