pip不升级包

时间:2014-03-19 11:50:52

标签: python pip upgrade

我安装了以下版本的numpy:

sh-3.2# pip --version
pip 1.5.4 from /usr/local/lib/python2.7/site-packages (python 2.7)

sh-3.2# pip list
...
numpy (1.7.1)
...

sh-3.2# pip install --upgrade --ignore-installed numpy
Downloading/unpacking numpy
  Downloading numpy-1.8.0.tar.gz (3.8MB): 3.8MB downloaded
  Running setup.py (path:/private/tmp/pip_build_root/numpy/setup.py) egg_info for package numpy
    Running from numpy source directory.

...installing stuff..

Successfully installed numpy
Cleaning up...
sh-3.2# pip list
...
numpy (1.7.1)
...

如您所见:没有升级。那怎么样?

更新:完成安装过程的输出:http://pastebin.com/wki2JNyh

Update2:实际上我认为路径应该没问题:

sh-3.2# which pip
/usr/local/bin/pip
sh-3.2# ls -l /usr/local/bin/pip
lrwxr-xr-x  1 Tom  admin  30 15 Jun  2013 /usr/local/bin/pip -> ../Cellar/python/2.7.5/bin/pip
sh-3.2# which python
/usr/local/bin/python
sh-3.2# ls -l /usr/local/bin/python
lrwxr-xr-x  1 Tom  admin  33 15 Jun  2013 /usr/local/bin/python -> ../Cellar/python/2.7.5/bin/python
sh-3.2# pip --version
pip 1.5.4 from /usr/local/lib/python2.7/site-packages (python 2.7)

目录/usr/local/lib/python2.7/site-packages包含以下内容:

Ghost.py-0.1b3-py2.7.egg-info                       patsy-0.2.1-py2.7.egg-info                          setuptools.pth
IPython                                             pip                                                 sip.so
PyQt4                                               pip-1.5.4-py2.7.egg-info                            sipconfig.py
astroid                                             pylab.pyc                                           sipconfig.pyc
astroid-1.0.0-py2.7.egg-info                        pylint                                              sipdistutils.py
backports                                           pylint-1.0.0-py2.7.egg-info                         site.py
backports.ssl_match_hostname-3.4.0.2-py2.7.egg-info pyparsing-2.0.1-py2.7.egg-info                      site.pyc
dateutil                                            pyparsing.py                                        sitecustomize.py
distribute-0.6.45-py2.7.egg                         pyparsing.pyc                                       sitecustomize.pyc
easy-install.pth                                    python_dateutil-2.2-py2.7.egg-info                  six-1.6.1-py2.7.egg-info
ghost                                               pytz                                                six.py
ipython-1.2.1-py2.7.egg-info                        pytz-2013.7-py2.7.egg-info                          six.pyc
logilab                                             redis                                               sklearn
logilab_common-0.60.0-py2.7-nspkg.pth               redis-2.8.0-py2.7.egg-info                          statsmodels
logilab_common-0.60.0-py2.7.egg-info                scikit_learn-0.14.1-py2.7.egg-info                  statsmodels-0.5.0-py2.7.egg-info
matplotlib                                          scikits                                             tests
nose                                                scikits.statsmodels-0.3.1-py2.7-nspkg.pth           tornado
nose-1.3.1-py2.7.egg-info                           scikits.statsmodels-0.3.1-py2.7.egg-info            tornado-3.2-py2.7.egg-info
numpy                                               scipy                                               wx-2.9.5-osx_cocoa
numpy-1.7.1-py2.7.egg-info                          scipy-0.12.0-py2.7.egg-info                         wx.pth
numpy-1.8.0-py2.7.egg-info                          scipy-0.13.3-py2.7.egg-info                         wxPython_common-2.9.5.0-py2.7.egg-info
pandas                                              selenium                                            wxversion.py
pandas-0.12.0-py2.7.egg-info                        selenium-2.39.0-py2.7.egg-info
patsy                                               setuptools-0.6c11-py2.7.egg-info

2 个答案:

答案 0 :(得分:0)

您的pip命令显示来自/usr/local/lib/python2.7的python, 在安装过程中/usr/local/Cellar/python/2.7.5/

是符号链接还是其他路径?

答案 1 :(得分:0)

好的,问题是以某种方式保留了旧包。因此,我只是进入了directoy并删除了相应的包。

这是我做的:

sh-3.2# pip list | grep numpy
numpy (1.7.1)
sh-3.2# pwd
/usr/local/lib/python2.7/site-packages
sh-3.2# rm numpy*
sh-3.2# pip install numpy
sh-3.2# pip list | grep numpy
numpy (1.8.0)

现在它运作正常!