OS X Uninstall a distutils installed project

前端 未结 4 727
星月不相逢
星月不相逢 2021-01-05 16:12

I\'m on El Capitan and I want to install numpy with pip. However I get the following error:

Detected a distutils installed project (\'numpy\') which we canno         


        
4条回答
  •  孤城傲影
    2021-01-05 16:52

    The "correct" way to this is to create a virtualenv and install the version of NumPy that you want in that.

    $ virtualenv pandas
    New python executable in /Users/gaius/pandas/bin/python
    Installing setuptools, pip, wheel...done.
    $ . pandas/bin/activate
    (pandas) Dawn-Treader:~ gaius$ pip install pandas
    Collecting pandas
    

    If you look at the one you already have:

    >>> import numpy
    >>> numpy.__file__
    '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc'
    

    There's no guarantee that that won't be touched by a future OSX patch or upgrade and your changes overwritten, if you do it manually.

提交回复
热议问题