pip install --user正在安装到python / site-packages而不是python2.7 / site-packages

时间:2015-04-07 17:05:37

标签: python pip

我试图让pip install --user使用预建的python系统,这有点尴尬。我们主要使用它,但由于某种原因pip install --user安装到~/.casa/lib/python/site-packages(其中.casa替换.local以安装python),但我不能了解这是如何设置的。

pip install --user如何选择其目录?我可能设置了什么导致它选择python/site-packages而不是pythonX.Y/site-packages

pip安装程序的源代码在此包中: https://github.com/radio-astro-tools/casa-python 据我所知,在该代码中没有出现python/site-packages的情况;它应该是pythonX.Y/site-packages

编辑: 使用以下脚本调用我使用的点。这里的东西可能有问题,但我无法确定:

$HOME/.casa/bin/casa-python $HOME/.casa/bin/pip $* --user

反过来使用casa-python,即此脚本:

#!/bin/sh

INSTALLPATH=/Applications/CASA.app/Contents

PROOT=$INSTALLPATH/Frameworks/Python.framework/Versions/2.7
PBIND=$PROOT/MacOS
PLIBD=$PROOT/lib/python2.7
PPATH=$PBIND:$PLIBD:$PLIBD/plat-mac:$PLIBD/plat-darwin
PPATH=$PPATH:$PBIND/lib-scriptpackages:$PLIBD/lib-tk
PPATH=$PPATH:$PLIBD/lib-dynload:$PLIBD/site-packages
PPATH=$PPATH:$PLIBD/site-packages/Numeric:$PLIBD/site-packages/PyObjC
PPATH=$INSTALLPATH/Resources/python:$PPATH

export PYTHONUSERBASE=$HOME/.casa

export PYTHONHOME=$PROOT
export PYTHONPATH=/Users/adam/.casa/lib/python2.7/site-packages:$PPATH
export PYTHONEXECUTABLE=$PROOT/Resources/Python.app/Contents/MacOS/Python

export DYLD_FRAMEWORK_PATH="$INSTALLPATH/Frameworks"

exec -a pythonw $INSTALLPATH/MacOS/pythonw -W ignore::DeprecationWarning "$@"

0 个答案:

没有答案