简体   繁体   English

如何在 Mac OSX 10.9.4 上卸载 pygame

[英]How to uninstall pygame on mac OSX 10.9.4

In fact, I meet the problem that my pygame can not load png image and the method pygame.image.get_extended() returns 0, which means false事实上,我遇到了我的pygame无法加载png图像并且方法pygame.image.get_extended()返回0,这意味着false的问题

Traceback (most recent call last): File "testpygame.py", line 5, in <module> myimage = pygame.image.load("diamond.png") pygame.error: File is not a Windows BMP file

I search for solutions and some people suggest that installing the proper version of pygame might help, so I want to uninstall my current pygame and reinstall我搜索解决方案,有些人建议安装正确版本的 pygame 可能会有所帮助,所以我想卸载我当前的 pygame 并重新安装

But I dont know how to uninstall pygame on OSX但我不知道如何在 OSX 上卸载 pygame

I installed 2 versions of python on mac (2.7 and 3.3), they are in the list of applications.我在 mac(2.7 和 3.3)上安装了 2 个版本的 python,它们在应用程序列表中。 But as we all know that the default python in mac that runs in terminal is another one given by the operating system itself, the different versions of python in mac totally confused me...但是众所周知,mac中在终端中运行的默认python是操作系统本身给出的另一个,mac中不同版本的python完全让我感到困惑......

So, how can I uninstall pygame of the proper python version in my mac..?那么,如何在我的 mac 中卸载正确的 python 版本的 pygame ..? Thanks a lot非常感谢

I figure out the solution by finding my python's path in OSX, and delete the pygame library in site-package.我通过在 OSX 中找到我的 python 路径来找出解决方案,并删除 site-package 中的 pygame 库。 My python's site-package's path is /Library/Python/2.7/site-packages, and I delete the pygame relevant folders here to uninstall pygame.我的python的site-package的路径是/Library/Python/2.7/site-packages,我在这里删除pygame相关文件夹卸载pygame。

After I uninstall pygame and reinstall it, the problem that 'pygame.error: File is not a Windows BMP file' was also solved.卸载pygame重新安装后,'pygame.error: File is not a Windows BMP file'的问题也解决了。

Just wanted to add a quick correction to the path of pythons site package to the above mentioned answer - It should look something like this只是想对上面提到的答案的pythons站点包的路径添加一个快速更正 - 它应该看起来像这样

" /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame" “ /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame”

I uninstalled pygame using pip & this is the output on the console.我使用 pip 卸载了 pygame,这是控制台上的输出。

pip uninstall pygame
Uninstalling pygame-1.9.1release:
  /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame
  /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame-1.9.1release-py2.7.egg-info
Proceed (y/n)? y
  Successfully uninstalled pygame-1.9.1release
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

My copy of pygame was installed via the disk image (.dmg) from this download page , which contains a package installer (.mpkg).我的 pygame 副本是通过此下载页面中的磁盘映像 (.dmg) 安装的,其中包含一个包安装程序 (.mpkg)。 You can attempt to uninstall the package , but that didn't work for me.您可以尝试卸载该软件包,但这对我不起作用。 Using the Suspicious Package app, I can look at the installer to see what it installs.使用可疑包应用程序,我可以查看安装程序以查看它安装的内容。

For the 1.9.1 version of Pygame, it installs the following:对于 1.9.1 版本的 Pygame,它会安装以下内容:

/Developer/Python/pygame
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pygame
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame-1.9.1release-py2.7.egg-info
/Library/Frameworks/SDL_image.framework
/Library/Frameworks/SDL_mixer.framework
/Library/Frameworks/SDL_ttf.framework
/Library/Frameworks/SDL.framework
/Library/Frameworks/smpeg.framework

You can manually delete all of these files to clear pygame from your system.您可以手动删除所有这些文件以从系统中清除 pygame。

Note that Python.framework is where all user-installed versions of Python go to.请注意, Python.framework是所有用户安装的 Python 版本所在的位置。 If you are sure that you do not have a user-installed version of Python, you can delete it entirely.如果您确定没有用户安装的 Python 版本,则可以将其完全删除。 Otherwise, you should surgically remove the pygame parts as shown above.否则,您应该如上图所示通过手术移除 pygame 部分。

It's pretty late now to answer this question but for me the solution was quite simple.现在回答这个问题已经很晚了,但对我来说,解决方案很简单。 Just copy the folder 3.x from /Library/Frameworks/Python.framework/Versions and paste it in the /Library/Python folder (assuming you have Python 3.x installed).只需从 /Library/Frameworks/Python.framework/Versions 复制文件夹 3.x 并将其粘贴到 /Library/Python 文件夹中(假设您安装了 Python 3.x)。

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

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