简体   繁体   English

默认的python不会找到随自制软件安装的模块

[英]default python does not locate modules installed with homebrew

I am installing modules with homebrew and other installers, and they are not recognized by my default python. 我正在使用自制软件和其他安装程序安装模块,而我的默认python无法识别它们。 Module installations with easy_install (such as pip) appear to be available for my system and system python). 使用easy_install的模块安装(例如pip)似乎可用于我的系统和系统python)。

My default python is located here and is this version: 我的默认python位于此处,并且是此版本:

15:49 [~]: which python 15:49 [〜]:哪个python
/usr/local/bin/python / usr / local / bin / python

15:49 [~]: python -d 15:49 [〜]:python -d
Python 2.7.2 (default, Mar 18 2012, 15:13:08) Python 2.7.2(默认,2012年3月18日,15:13:08)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin Type "help", "copyright", "credits" or "license" for more information. darwin上的[GCC 4.2.1(Apple Inc.内部版本5577)]键入“帮助”,“版权”,“信用”或“许可证”以获取更多信息。

The packages do appear to be located in /library/frameworks/, GEOS.framework is one example. 软件包确实位于/ library / frameworks /中,GEOS.framework是一个示例。

What do I need to modify to gain access to my modules? 我需要修改什么才能访问我的模块?

System: Mac os x 10.5.8 系统:Mac OS X 10.5.8

From the Homebrew page: "Homebrew installs packages into their own isolated prefix and then symlinks everything into /usr/local" 在Homebrew页面上:“ Homebrew将软件包安装到它们自己的隔离前缀中,然后将所有内容符号链接到/ usr / local”

I think that the OS X preinstalled python looks for modules in /Library/Frameworks/Python.framework/Versions/Current//lib/python2.7/site-packages 我认为OS X预装的python在/Library/Frameworks/Python.framework/Versions/Current///lib/python2.7/site-packages中查找模块

So maybe you need to symlink your Homebrew installed packages to there. 因此,也许您需要将Homebrew安装的软件包符号链接到此处。

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

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