是否可以在Mac上安装homebrew-ed和Enthought python而不互相干扰?
我非常喜欢在 Mac(OS X 10.6、x86_64)上使用自制程序进行包管理。然而,我一直在尝试安装MayaVi和wxPython等,这完全是一场噩梦。是否可以从预构建的二进制文件中安装 Enthought Python Distribution,而不会破坏我的自制程序设置?
谢谢! 乌里
I am a big fan of homebrew for package management on my Mac (OS X 10.6, x86_64). However, I have been trying to install MayaVi and wxPython, etc., which has been a total nightmare. Is it possible to install Enthought Python Distribution from their prebuilt binaries in a way that's not going to break my homebrew setup?
Thanks!
Uri
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只要 PATH 和 PYTHONPATH 设置正确,应该没问题。
我自己并行使用官方最新的 Python 发行版 (2.7.x)、32 位 EPD Python 和 64 位 Python,我所要做的就是快速编辑我的 .bash_profile 以适当地设置 PATH。
应该有更聪明的方法来有效地管理不同的版本,例如,保持 PATH 和 PYTHONPATH 不变,但让它们指向一个软链接,当您想使用不同的 Python 时您可以更改该软链接(例如 /Library/ 中的链接) Frameworks/Python.Framework/Versions/Current),但我更喜欢快速注释掉 .bash_profile 中的 PATH 定义。
管理不同设置的另一个系统是 python 包 virtualenv
That should be no problem, as long as the PATH and the PYTHONPATH are set correctly.
I myself use the official newest Python distribution (2.7.x), the 32-bit EPD Python and the 64-bit Python in parallel and all I have to do is to quickly edit my .bash_profile to set the PATH appropriately.
There should be more clever methods out there to manage different versions efficiently, e.g. leave the PATH and PYTHONPATH untouched, but let them point to a soft link which you would change when you want to use a different Python (like the link in /Library/Frameworks/Python.Framework/Versions/Current) but I prefer to quickly comment out the PATH definitions in my .bash_profile.
Another system to manage different setups is the python package virtualenv
K.-Michael Aye 写的似乎有效。我花了一些时间才理解(我是一个Python和终端菜鸟),以防其他人处于这个位置,这里有一些代码:
你的
.bash_profile
告诉你的系统要使用什么Python包。它位于~/.bash_profile
中,安装 EPD python 后应该看起来像这样:注释掉
PATH
和export
行。重新启动终端并检查 Homebrew:完成brew 安装后,取消注释这些行并再次重新启动终端以使用 EPD python。
What K.-Michael Aye wrote seems to work. It took me a bit to understand (I'm a python and terminal noob) in case someone else is in that position here's some code:
Your
.bash_profile
tells your system what python package to use. It's located at~/.bash_profile
and should look something like this with EPD python installed:Comment out the
PATH
andexport
lines. Restart terminal and check Homebrew:When you're done with the brew install, uncomment those lines and restart the terminal again to use the EPD python.
我也会尝试 python
virtualenv
- 这将允许你拥有你的“默认”环境具有自制程序的优点,然后当您想要使用 EPD 运行时,您可能必须卸载/重新安装 Enthought,它可能有自己的 挑战。
当我沿着这条路走下去时,我最终放弃了 EPD,转而使用 d3 (d3js.org) 及其相关的 python 库 (https://github.com/mikedewar/d3py) 使用基于 Web 的图形
I would also try python
virtualenv
- this would allow you to have your "default" environment with the homebrew goodness, and then when you want to use EPD runYou will probably have to uninstall/reinstall Enthought, which may have its own challenges.
When I went down this path, I ended up abandoning EPD and went back to web based graphics with d3 (d3js.org) and its associated python library (https://github.com/mikedewar/d3py)