Назад | Перейти на главную страницу

Запутанная версия Python

На моем Mac OS X Lion я набираю в Терминале следующее:

hobbes3@hobbes3:~$ which python
/usr/local/bin/python
hobbes3@hobbes3:~$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
hobbes3@hobbes3:~$ /usr/local/bin/python
Python 2.7.2 (default, Feb 23 2012, 00:05:44) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Часть моей /usr/local/bin/ выглядит так:

lrwxr-xr-x   1 root  wheel    32B Feb 23 00:07 pydoc -> ../Cellar/python/2.7.2/bin/pydoc
lrwxr-xr-x   1 root  wheel    33B Feb 23 00:07 python -> ../Cellar/python/2.7.2/bin/python
lrwxr-xr-x   1 root  wheel    40B Feb 23 00:07 python-config -> ../Cellar/python/2.7.2/bin/python-config
lrwxr-xr-x   1 root  wheel    36B Feb 23 00:07 python2.7 -> ../Cellar/python/2.7.2/bin/python2.7
lrwxr-xr-x   1 root  wheel    43B Feb 23 00:07 python2.7-config -> ../Cellar/python/2.7.2/bin/python2.7-config
lrwxr-xr-x   1 root  wheel    34B Feb 23 00:07 pythonw -> ../Cellar/python/2.7.2/bin/pythonw
lrwxr-xr-x   1 root  wheel    37B Feb 23 00:07 pythonw2.7 -> ../Cellar/python/2.7.2/bin/pythonw2.7

Почему я впервые печатаю python У меня v2.7.1, но когда я набираю полный путь /usr/local/bin/python У меня v2.7.2?

Я установил v2.7.2 с помощью homebrew, и я хотел бы использовать эту версию, потому что считаю, что мой Django установлен под v2.7.2 python.

Потому что бедный bash сбит с толку. Очистить pythonхеш-запись.

hash -d python