简体   繁体   English

在Mac上下载python 3的pygame错误

[英]Downloading pygame for python 3 on mac error

I tried to install pygame on my macbook pro by entering pip install pygame into the terminal. 我尝试通过在终端输入pip install pygame install pygame在我的macbook pro上pip install pygame It didn't work and it just gave me: 它没有用,只是给了我:

Collecting pygame Using cached pygame-1.9.3-cp27-cp27m-macosx_10_9_intel.whl Installing collected packages: pygame Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install **kwargs File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files clobber(source, lib_dir, True) File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in clobber ensure_dir(destdir) File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir os.makedirs(path) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pygame'

I'm kinda new to programming and using the terminal for things so I might have made a huge stupid mistake but if you know what I did wrong or what I have to do to fix it please tell me. 我是编程和使用终端的新手,所以我可能犯了一个巨大的愚蠢错误,但是如果您知道我做错了什么或必须解决的问题,请告诉我。

I think you are running the command as a user that does not have permission to write to the system folders containing the Python base. 我认为您正在以没有权限写入包含Python base的系统文件夹的用户身份运行命令。 Not sure on a Mac how you run a sudo command. 在Mac上不确定如何运行sudo命令。

Use sudo pip install pygame to install. 使用sudo pip install pygame进行安装。 The last line of the error says permission denied, meaning you don't have permission as the current user. 错误的最后一行说,权限被拒绝,这意味着您没有当前用户的权限。 Sudo will temporarily make you root. Sudo会暂时使您成为root。

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

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