Mac版Enthought Canopy能否切换为32位Python以适配pygame?
Switching Enthought Canopy to 32-bit Python on MacOS 10.13.2 for pygame
Hey there! Let's get your Enthought Canopy running in 32-bit mode so you can use pygame without issues. Since you're new to this, I'll walk you through the simplest methods step by step:
Method 1: Launch Canopy in 32-bit Mode Temporarily
This is perfect if you only need the 32-bit environment occasionally:
- First, close all open Canopy windows (editor, terminal, package manager—everything).
- Open your Mac's Terminal (find it in Launchpad > Other).
- Run this command to start Canopy in 32-bit mode:
arch -i386 /Applications/Canopy.app/Contents/MacOS/Canopy - Once it launches, your Canopy environment will be running 32-bit Python, and you should be able to install and use pygame successfully.
Method 2: Set Canopy to Default to 32-bit Mode
If you want 32-bit to be the default every time you open Canopy:
- Close all Canopy windows first.
- Find
Canopy.appin your/Applicationsfolder. Right-click it and select Show Package Contents. - Navigate to the
Contentsfolder and locate theInfo.plistfile. - Open it with a text editor (like TextEdit—if you hit a permission error, use
sudo nano /Applications/Canopy.app/Contents/Info.plistin Terminal instead). - Look for the
LSArchitecturePrioritykey. If it exists, change the value fromx86_64toi386. If it doesn't exist, add this block to the file:<key>LSArchitecturePriority</key> <array> <string>i386</string> </array> - Save the file and restart Canopy. It will now launch in 32-bit mode by default.
Important Notes
- Keep in mind that switching to 32-bit means any 64-bit packages you previously installed might stop working. If you need to go back to 64-bit later, just reverse the steps above, or run
arch -x86_64 /Applications/Canopy.app/Contents/MacOS/Canopyin Terminal. - Make sure you install a 32-bit compatible version of pygame. You can use Canopy's built-in Package Manager to search for pygame and pick the version that matches your 32-bit environment.
内容的提问来源于stack exchange,提问作者Zach658
相关产品推荐
相关产品推荐

