OS X Uninstall a distutils installed project

前端 未结 4 726
星月不相逢
星月不相逢 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.

    0 讨论(0)
  • 2021-01-05 16:56

    It might be that your item was installed with anaconda. For your numpy, Try:

    conda uninstall numpy
    

    I got the same error, and this fixed it for me.

    0 讨论(0)
  • 2021-01-05 17:03

    It works when I had trouble with uninstall tensorflow of lower version. It should be that if a package is installed by conda, the way to uninstall it through

    0 讨论(0)
  • 2021-01-05 17:05

    Since there is no metadata about the installed files, I found the easiest way to be removing the files manually. Simply retrieve the directory of the module (I referred to this: Retrieving python module path), and delete the folder, as well as the accompanying .egg-info file. Then install your desired numpy version without the --update flag.

    0 讨论(0)
提交回复
热议问题