简体   繁体   English

mac easy_install问题

[英]mac easy_install problem

I've tried to install a python package using easy_install. 我尝试使用easy_install安装python包。 I used the easy_install from /usr/local/bin as I thought that was the one supplied by macpython. 我使用了/ usr / local / bin中的easy_install,因为我认为这是macpython提供的。 I've encountered this problem: 我遇到过这个问题:

ValueError: numpy >= 1.4 is required (detected 1.2.1 from /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/__init__.pyc)

It seems like when checking for dependencies, easy_install is looking at the directory pointed by python that was shipped with Mac. 看起来在检查依赖项时,easy_install正在查看Mac附带的python指向的目录。

How can I alter this? 我怎么能改变这个?

You can use virtualenv with --no-site-packages then install your package into there. 您可以将virtualenv--no-site-packages然后将包安装到那里。 You might also want to investigate pip instead of easy_install . 您可能还想调查pip而不是easy_install

If you are running a different version of python from the system supplied one, find the framework bin directory for that version, for example: 如果您从系统提供的python中运行不同版本的python,请找到该版本的框架bin目录,例如:

$ ls -l $(which python2.7)
lrwxr-xr-x  1 root  wheel  71 Jul 13  2010 /usr/local/bin/python2.7 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7

Then run the version of easy_install that is in that directory: 然后运行该目录中的easy_install版本:

/Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install

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

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