是否可以在Mac上安装homebrew-ed和Enthought python而不互相干扰?

发布于 2024-12-09 07:38:28 字数 162 浏览 0 评论 0原文

我非常喜欢在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

熟人话多 2024-12-16 07:38:28

只要 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

找个人就嫁了吧 2024-12-16 07:38:28

K.-Michael Aye 写的似乎有效。我花了一些时间才理解(我是一个Python和终端菜鸟),以防其他人处于这个位置,这里有一些代码:

你的.bash_profile告诉你的系统要使用什么Python包。它位于 ~/.bash_profile 中,安装 EPD python 后应该看起来像这样:

# Setting PATH for EPD-7.3-2
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
export PATH

MKL_NUM_THREADS=1
export MKL_NUM_THREADS

注释掉 PATHexport 行。重新启动终端并检查 Homebrew:

$ brew doctor
Your system is raring to brew.

完成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:

# Setting PATH for EPD-7.3-2
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
export PATH

MKL_NUM_THREADS=1
export MKL_NUM_THREADS

Comment out the PATH and export lines. Restart terminal and check Homebrew:

$ brew doctor
Your system is raring to brew.

When you're done with the brew install, uncomment those lines and restart the terminal again to use the EPD python.

雅心素梦 2024-12-16 07:38:28

我也会尝试 python virtualenv - 这将允许你拥有你的“默认”环境具有自制程序的优点,然后当您想要使用 EPD 运行时,

python virtualenv.py 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 run

python virtualenv.py EPD

You 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文