如何在USB驱动器上安装pip?

时间:2014-01-09 18:15:56

标签: python git bash pip

我正在尝试在usb驱动器上安装pip:在便携式python旁边,但它似乎不起作用。我正在使用Git-bash(msy​​s)作为我的命令行。请参阅下面的我的尝试:

MYPC /f
$ which python
/f/ppython275/App/python    

MYPC /f
$ which pip    

MYPC /f
$ python get-pip.py
Downloading/unpacking pip
  Downloading pip-1.5.tar.gz (898kB): 898kB downloaded
  Running setup.py egg_info for package pip    

    warning: no files found matching 'pip\cacert.pem'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.rst' found under directory 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
Installing collected packages: pip
  Running setup.py install for pip    

    warning: no files found matching 'pip\cacert.pem'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.rst' found under directory 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
    Installing pip-script.py script to f:\ppython275\App\Scripts
    Installing pip.exe script to f:\ppython275\App\Scripts
    Installing pip.exe.manifest script to f:\ppython275\App\Scripts
    Installing pip2.7-script.py script to f:\ppython275\App\Scripts
    Installing pip2.7.exe script to f:\ppython275\App\Scripts
    Installing pip2.7.exe.manifest script to f:\ppython275\App\Scripts
    Installing pip2-script.py script to f:\ppython275\App\Scripts
    Installing pip2.exe script to f:\ppython275\App\Scripts
    Installing pip2.exe.manifest script to f:\ppython275\App\Scripts
Successfully installed pip
Cleaning up...    

MYPC /f
$ which pip

我重新启动了命令行。但“哪个点”仍然没有产生任何结果。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

您需要编辑$PATH环境变量以添加/f/ppython275/App/Scripts,以便shell在该目录中查找可执行文件。

修改您的~/.bashrc~/.bash_profile并添加以下内容:

export PATH=$PATH:/f/ppython275/App/Scripts

保存,重新启动你的shell,你应该全部设置。