简体   繁体   English

在OS X上将MacPorts安装的Python软件包与Enthought(或其他一些)Python一起使用?

[英]Using MacPorts-installed Python packages with Enthought(or some other) Python on OS X?

I have two installations of Python 2.7.2 -- from MacPorts and Enthought -- on my Mac. 我在Mac上安装了两个Python 2.7.2安装-来自MacPorts和Enthought。 I use the Enthought Python as the primary one; 我使用Enthought Python作为主要的Python。 however, the MacPorts distribution has several additional packages like pymacs, rope etc., which I would like to make available to the Enthought Python. 但是,MacPorts发行版还有其他一些软件包,例如pymacs,rope等,我想将它们提供给Enthought Python。 (I'm actually trying to use Emacs w/ Enthought Python, but also make use of the MacPorts-installed Rope, Pymacs for code completion in Emacs). (我实际上是在尝试使用带有Enthought Python的Emacs,但也要利用MacPorts安装的Rope Pymacs在Emacs中完成代码)。

Is there a clean way to make the MacPorts packages available to the Enthought Python without breaking anything? 有没有一种干净的方法就可以使MacPorts软件包对Enthought Python可用而又不会破坏任何内容?

It's risky trying to combine the two distributions, as you are likely to get conflicts (especially for C-extensions linked to slightly different versions of shared libraries). 尝试将两个发行版合并在一起是有风险的,因为您可能会遇到冲突(尤其是对于链接到共享库的稍有不同版本的C扩展)。 This is a common cause of problems with EPD: 这是造成EPD问题的常见原因:

https://support.enthought.com/entries/22094157-OS-X-Conflict-with-installed-packages-in-earlier-Python-installation https://support.enthought.com/entries/22094157-OS-X-Conflict-with-installed-packages-in-earlier-Python-installation

The recommended way to install new packages in EPD is with the enpkg tool. 建议在EPD中安装新软件包的方法是使用enpkg工具。 You can find out more about enpkg with enpkg --help or in this article: 您可以使用enpkg --help或在本文中找到有关enpkg的更多信息:

https://support.enthought.com/entries/22415022-Using-enpkg-to-update-EPD-packages https://support.enthought.com/entries/22415022-Using-enpkg-to-update-EPD-packages

If your package isn't available through enpkg (in your case it looks like rope is while pymacs is not, assuming you have an appropriate subscription), EPD is a very standard python distribution, and you can install packages in it through normal means such as pip or by grabbing the source and running python setup.py install . 如果您的软件包无法通过enpkg获得(假设您拥有适当的订阅,则您的情况似乎是rope pymacs ,而pymacs则无法使用),EPD是非常标准的python发行版,您可以通过常规方式在其中安装软件包作为pip或通过获取源代码并运行python setup.py install See: 看到:

https://support.enthought.com/entries/22914233-Using-non-EPD-package-installers-such-as-pip https://support.enthought.com/entries/22914233-Using-non-EPD-package-installers-such-as-pip

It would be cleaner to install the additional packages once more for the Enthought Python. 再次为Enthought Python安装附加软件包会更清洁。 Trying to reuse packages from another installation seems neither clean nor safe to me. 尝试重用其他安装中的软件包对我来说既不干净也不安全。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM