使用scl

时间:2016-04-23 03:29:44

标签: python pip centos6

我试图通过所有已知方法在CentOS上配置pip目标路径无济于事。我没有su权利。我做了什么:

export PYTHONPATH=$HOME/tools/.usr/py2/lib
echo $PYTHONPATH
# returns $HOME/tools/.usr/py2/lib

~/.pydistutils.cfg的内容:

[install]
install_scripts = $HOME/tools/.usr/py2/scripts
install_data = $HOME/tools/.usr/py2/data
install_lib = $HOME/tools/.usr/py2/lib

运行

scl enable python27 '$HOME/tools/.usr/py2/scripts/pip install --install-option="--home=$HOME/tools/.usr/py2/lib" ipython'

会产生如下警告:

Target directory $HOME/tools/.usr/py3/lib/pathlib2.py already exists. Specify --upgrade to force replacement.

即。它使用了上面列出的所有其他路径文件或变量,并认为目标是$HOME/tools/.usr/py3/lib。为什么会如此以及如何强制它到我的$PYTHONPATH

另一次尝试:

scl enable python27 '$HOME/tools/.usr/py2/scripts/pip install --install-option="--prefix=/ye/netapp/jimmie.ye/tools/.usr/py2/lib" --upgrade pip'
$HOME/tools/.usr/py2/lib/pip-8.1.1-py2.7.egg/pip/commands/install.py:180: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options)
Collecting pip
  Using cached pip-8.1.1.tar.gz
Installing collected packages: pip
  Running setup.py install for pip ... error
    Complete output from command /opt/rh/python27/root/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/scrapp/dlituiev/pip-build-pGEJ7L/pip/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /scrapp/dlituiev/pip-SScyQc-record/install-record.txt --single-version-externally-managed --compile --prefix=/ye/netapp/jimmie.ye/tools/.usr/py2/lib --home=/scrapp/dlituiev/tmps67g2R:
    running install
    error: must supply either home or prefix/exec-prefix -- not both

    ----------------------------------------
Command "/opt/rh/python27/root/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/scrapp/pip-build-pGEJ7L/pip/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /scrapp/dlituiev/pip-SScyQc-record/install-record.txt --single-version-externally-managed --compile --prefix=$HOME/tools/.usr/py2/lib --home=/scrapp/tmps67g2R" failed with error code 1 in /scrapp/pip-build-pGEJ7L/pip/

所有$HOME在原始命令和错误中拼写完整。

0 个答案:

没有答案