更改easy_install的python路径

时间:2013-03-24 02:38:00

标签: python easy-install

我在使用macports尝试多次后使用mac我决定切换到常规的python路径,所以现在我的python路径是

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

但是当我安装django时,我的mac stil使用Apple安装的python,如何告诉easy_install使用上面的python路径而不是apple install python:

[~/mysite/djangosite]$sudo easy_install django==1.5
Searching for django==1.5
Best match: Django 1.5
Processing Django-1.5-py2.6.egg
Django 1.5 is already the active version in easy-install.pth
Installing django-admin.py script to /usr/local/bin

Using /Library/Python/2.6/site-packages/Django-1.5-py2.6.egg
Processing dependencies for django==1.5
Finished processing dependencies for django==1.5
anu@localhost:[~/mysite/djangosite]$which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

我已经尝试使用哪个easy_install来查看easy_install使用了什么/usr/bin/easy_install我也进了/Library/Frameworks/Python.framework/Versions/2.7/bin来检查easy_install但是我找不到easy_install。 。

localhost:[/Library/Frameworks/Python.framework/Versions/2.7/bin]$ls
2to3            idle2           pydoc2.7        python2         python2.7-32        pythonw2        smtpd.py
2to3-2          idle2.7         python          python2-32      python2.7-config    pythonw2-32     smtpd2.7.py
2to3-2.7        pydoc           python-32       python2-config      pythonw         pythonw2.7      smtpd2.py
idle            pydoc2          python-config       python2.7       pythonw-32      pythonw2.7-32

/Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install*什么都没有,

1 个答案:

答案 0 :(得分:0)

执行which easy_install并确保获得/Library/Frameworks/Python.framework/Versions/2.7/bin下的那个,或者直接运行该目录下的easy_install。之后,您应该在您想要的目录下安装django。