?
↑前回powerline-statusをアップデートしたら治ったぜブログを書きましたが、
個人のもう一台のMacでアップデートするとエラー出まくったのでPythonを入れ直して
pipをインストールしたところpipもインストールできない状況になり、究極ハマったのでブログします。
■easy_install pip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
$ sudo easy_install pip TEST FAILED: /lib/python2.7/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: /lib/python2.7/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: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again. |
PYTHONPATHが空だからちゃんと設定やれと怒られたので以下のように指定してみる。
・export
1 |
$ export PYTHONPATH = "/lib/python2.7/site-packages" |
しかし、エラーは変わらず。。
とりあえず$ brew doctorをやってみる。
■brew doctor
1 2 3 4 5 6 7 8 9 |
$ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: A .pydistutils.cfg file was found in $HOME, which may cause Python builds to fail. See: https://bugs.python.org/issue6138 https://bugs.python.org/issue4655 |
ホームディレクトリに.pydistutils.cfgファイルが存在するとエラー出るので消せばいいと以下に書いてある。
・Brewed pip tries to write to /lib, fails under El Capitan #44836
https://github.com/Homebrew/legacy-homebrew/issues/44836
・rm .pydistutils.cfg
1 2 3 |
$ rm ~/.pydistutils.cfg remove /Users/adachin/.pydistutils.cfg? y /Users/adachin/.pydistutils.cfg |
■try again easy_install pip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
$ sudo easy_install pip Searching for pip Best match: pip 9.0.1 Adding pip 9.0.1 to easy-install.pth file Installing pip script to /usr/local/bin Installing pip2.7 script to /usr/local/bin Installing pip2 script to /usr/local/bin Using /usr/local/lib/python2.7/site-packages Processing dependencies for pip Finished processing dependencies for pip $ sudo pip install --upgrade pip Password: Downloading pip-9.0.2-py2.py3-none-any.whl (1.4MB) 100% |████████████████████████████████| 1.4MB 134kB/s Installing collected packages: pip Found existing installation: pip 9.0.1 Uninstalling pip-9.0.1: Successfully uninstalled pip-9.0.1 Successfully installed pip-9.0.2 $ sudo pip install powerline-status Collecting powerline-status Installing collected packages: powerline-status Successfully installed powerline-status-2.6 |
?
次回から/usr/local/lib/python2.7/site-packages配下にインストールされるようです。
/lib/python2.7は消しちゃってOK。
■まとめ
久しぶりに1時間くらいハマったw
?
0件のコメント