Short Description
Is it possible to install Python 2.7.1 64/32bit from python.org on top of an existing install (from python.org) of Python 2.7.1 32bit?Background
I installed the 32bit version for wxPython(2.8) support which until now has given me zero issues. There are a few modules that I am now having difficultly installing (psycopg2 and mysql-python). The warning messages in homebrew constantly warn me about not having a 64bit version of Python on the path. These warnings only add to my list of wanting to use a 64 bit version.At the time I selected the 32bit install, the GUI for a particular project was the main focus. Now the GUI has been come very simple and the database back-end support (using Django) is much more important. This being said, using the development version of wxPython 2.9 (which supports OS X and 64bit 2.7) has become acceptable.
For the non-mac users, to help explain why I had to use the 32bit version please see this Brief guide to using virtualenv in a wxpython project
System Information
Development System OS: Mac OS X Snow Leopard (10.6.7) Python: 2.7.1 with virutalenv / virutalenv-wrapper Project Dependencies: Note that MySQL could be PostgresSQL's psycopg2 if I can get the postgresql to install with homebrewDjango==1.2.5
MySQL-python==1.2.3 PIL==1.1.7 PyVISA==1.3 pyserial==2.5 virtualenv==1.5.1 virtualenvwrapper==2.6.3 wsgiref==0.1.2 wxPython==2.8.11.0 wxPython-common==2.8.11.0 开发者_StackOverflow中文版
Deployment System
OS: Windows XP / Windows 7 Python: Hopefully none (goal to use py2exe, or similar tool)Current Thoughts
I fear that my goal cannot be accomplished based on the file paths alone. In Windows 7 the identifier (x86) is placed in the path showing that it is a 32bit program, but on OS X the path would be the same for 32bit or 64/32bit installs (/Library/Frameworks/Python.framework/Versions/2.7/).Any thoughts or comments would be helpful!
Update 5-18-2011: 8:40 AM
I have confirmed that using the pre-compiled (.dmg) framework builds, installing the a 64 bit version does blow away the 32 bit install. This did negatively effect my virtual environments in that all of the things I have installed in the environments was based on the 32 bit install nearly every module threw an error of some sort.I still have not achieved installing 32 bit and 64 bit on the same machine, however looking into homebrew with greater detail does look this could be possible. The trick would be to define your own formulas for each of the python builds (from source) and rename the install directory to something like 'Python27_32' and 'Python27_64'. I'll keep exploring this front as I have time.
EDIT 7-12-2011: 10:51 AM CST
Has anyone out there been able control how homebrew compile options? Specifically how to select to use a 64bit compiler or a 32 bit compiler? I will create a new SO question if this doesn't bring anything up.Check out http://www.macports.org/ Which provides ports of various flavors of linux/unix tools that don't appear in the default MacInstallation and duplicates those that it needs otherwise. It installs everthing in /opt/local instead of stepping on the installed base. With some manipulation of PATH and LD_LIBRARY_PATH this might give you the options you need.
I would use something like virtualenv. This way you can have as many different installs of python as you wish.
EDIT: To use different versions of python use:
virtualenv -p python2.6
Reference
Another possible solution that was provided in an answer to one of my questions aimed at using a virtual environment in the Windows world was using Buildout. This approach looks like it would allow me create an environment with the 32bit installed and another one with the 64bit.
I have not tested this out yet, but wanted to pass it along to anyone else attempting this feat.
Cheers!
精彩评论