Я пытаюсь установить дистрибутив на свой mac с python 2.7, чтобы получить доступ к команде easy_install
. Я скачал последнюю версию: curl -O http://python-distribute.org/distribute_setup.py
OSX Install Python Distribute
И попытался запустить скрипт установки: sudo python distribute_setup.py
Но я получил эту ошибку:
$ sudo python distribute_setup.py
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
Extracting in /tmp/tmpth5J26
Now working in /tmp/tmpth5J26/distribute-0.6.49
Installing Distribute
Before install bootstrap.
Scanning installed packages
No setuptools distribution found
running install
Checking .pth file support in /Users/[my username]/Library/Python/2.6/site-packages/
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -E -c pass
TEST FAILED: /Users/[my username]/Library/Python/2.6/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Users/[my username]/Library/Python/2.6/site-packages/
and your PYTHONPATH environment variable currently contains:
''
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
variable. (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:
http://packages.python.org/distribute/easy_install.html#custom-installation-locations
Please make the appropriate changes for your system and try again.
Something went wrong during the installation.
See the error message above.
Я проверить, что переменная $PYTHONPATH
не установлено:
$ echo $PYTHONPATH
$
Которого я не понимаю. Другая вещь, которая меня беспокоила, заключается в том, что я хотел бы установить ее с помощью python 2.7, но каталог /Users/[my username]/Library/Python/2.7/site-packages/
даже не существует. Если возможно, я бы предпочел не использовать macports или home-brew, потому что считаю их беспорядочными. Вот некоторая информация о версии:
$ python -V
Python 2.7.6
И намного больше о моем питона установить:
$ python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py
import site # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py
import os # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py
import posixpath # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.py
import stat # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/stat.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py
import genericpath # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.py
import warnings # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/warnings.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py
import linecache # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.py
import types # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/types.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py
import UserDict # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py
import abC# precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.py
import copy_reg # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py
import traceback # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py
import sysconfig # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py
import re # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.py
import sre_compile # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.pyc
import _sre # builtin
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.py
import sre_parse # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.py
import sre_constants # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py
import _sysconfigdata # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.py
import _osx_support # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.pyc
import encodings # directory /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.py
import encodings # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/__init__.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py
import codecs # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.pyc
import _codecs # builtin
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/aliases.pyc
# /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.pyc matches /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py
import encodings.utf_8 # precompiled from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.pyc
Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so", 2);
import readline # dynamically loaded from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so
Вы считаете использовать 'pip' вместо' easy_install'? 'easy_install' устарел ... – MattDMo
@MattDMo Причина, по которой я пытаюсь получить' easy_install', заключается в том, что я пытаюсь установить другую программу, setup.py которой требует 'easy_install'. Не входит ли 'pip' в распространение? – 735Tesla
@MattDMo Кроме того, согласно домашнему пиву, мне нужно «easy_install». '$ brew install pip Ошибка: нет доступной формулы для pip: Homebrew предоставляет pip через: 'brew install python'. Однако у вас будет , у вас есть два Pythons, установленных на вашем Mac, так что вы также можете: sudo easy_install pip' – 735Tesla