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?
简短的描述是可以从python.org上安装Python 2.7.1 64/32位的Python 2.7.1 32位的安装(来自python.org)。
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.
我为wxPython(2.8)安装了32位版本的支持,直到现在我还没有遇到任何问题。现在有几个模块很难安装(psycopg2和mysql-python)。homebrew中的警告消息不断提醒我,在path上没有64位的Python版本。这些警告只会增加我想要使用64位版本的列表。
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.
在我选择32位安装时,一个特定项目的GUI是主要的焦点。现在GUI变得非常简单,数据库后端支持(使用Django)更重要。这就是说,使用wxPython 2.9的开发版本(支持OS X和64位2.7)已经变得可以接受了。
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
对于非mac用户来说,为了帮助解释为什么我必须使用32位版本,请参考wxpython项目中使用virtualenv的简要指南。
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 homebrew
系统信息开发系统OS: Mac OS X雪豹(10.6.7)Python: 2.7.1与virutalenv / virutalenv包装器项目依赖关系:请注意,如果我能获得postgresql安装与homebrew的连接,MySQL可能是PostgresSQL的psycopg2。
Django==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.0Django==1.2.5 MySQL-python== 1.1.7 PyVISA== 1.1.7 PyVISA== == == =1.5.1
Deployment System
OS: Windows XP / Windows 7
Python: Hopefully none (goal to use py2exe, or similar tool)
部署系统OS: Windows XP / Windows 7 Python:希望没有(使用py2exe或类似工具的目标)
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/).
目前的想法,我担心我的目标不能仅仅基于文件路径完成。在Windows 7中,标识符(x86)被放置在显示它是一个32位程序的路径中,但是在OS X上,路径将与32位或64/32位安装(/库/框架/Python.framework/版本/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.
更新5-18-2011:8:40 AM我已经确认使用预编译的(.dmg)框架构建,安装一个64位的版本确实会把32位的安装吹走。这对我的虚拟环境产生了负面影响,我在环境中安装的所有东西都基于32位安装,几乎每个模块都抛出了某种错误。
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.
我还没有在同一台机器上安装32位和64位,不过,更详细地看一下homebrew,这是可能的。其中的技巧是为每个python构建(从源代码)定义自己的公式,并将安装目录重命名为“Python27_32”和“Python27_64”。我将继续探索这方面,因为我有时间。
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.
编辑7-12-2011:10:51 AM CST有没有人可以控制自制程序的编译选项?具体如何选择使用64位编译器或32位编译器?我将创建一个新的问题,如果这没有带来任何东西。
3 个解决方案
#1
2
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.
查看http://www.macports.org/,它提供了不同风格的linux/unix工具的端口,这些工具不会出现在默认的MacInstallation中,并复制那些它需要的。它安装在/opt/local中,而不是安装在安装的基础上。通过对PATH和LD_LIBRARY_PATH的一些操作,这可能会给您所需的选项。
#2
0
I would use something like virtualenv. This way you can have as many different installs of python as you wish.
我会使用virtualenv之类的东西。这样,您就可以像您希望的那样拥有许多不同的python安装。
EDIT: To use different versions of python use:
编辑:使用不同版本的python:
virtualenv -p python2.6
参考
#3
0
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.
另一种可能的解决方案是使用Buildout来解决我的一个问题,即在Windows世界中使用虚拟环境。这种方法看起来可以让我创建一个安装了32位的环境,另一个是64位的。
I have not tested this out yet, but wanted to pass it along to anyone else attempting this feat.
我还没有测试过这个,但是想把它传递给其他尝试这个壮举的人。
Cheers!
干杯!
#1
2
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.
查看http://www.macports.org/,它提供了不同风格的linux/unix工具的端口,这些工具不会出现在默认的MacInstallation中,并复制那些它需要的。它安装在/opt/local中,而不是安装在安装的基础上。通过对PATH和LD_LIBRARY_PATH的一些操作,这可能会给您所需的选项。
#2
0
I would use something like virtualenv. This way you can have as many different installs of python as you wish.
我会使用virtualenv之类的东西。这样,您就可以像您希望的那样拥有许多不同的python安装。
EDIT: To use different versions of python use:
编辑:使用不同版本的python:
virtualenv -p python2.6
参考
#3
0
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.
另一种可能的解决方案是使用Buildout来解决我的一个问题,即在Windows世界中使用虚拟环境。这种方法看起来可以让我创建一个安装了32位的环境,另一个是64位的。
I have not tested this out yet, but wanted to pass it along to anyone else attempting this feat.
我还没有测试过这个,但是想把它传递给其他尝试这个壮举的人。
Cheers!
干杯!