0

I just realize that I have two python 2.7 libraries on my Mac. One is located at

/usr/local/lib/python2.7/site-packages

The other is at

/Users/myname/Library/Python/2.7/lib/python/site-packages

Is there a way to get rid of one of them? How can I modify sys.path accordingly to make sure I can still import module from the correct directory?

============================

I have this question because I found that there are two pip available on my machine. When I do pip install, it seems that I will invoke either one of them randomly. Recently I notice that from time to time I cannot import certain modules, like matplotlib, tflearn, etc. I look up sys.path, both site-packages directories are listed, so I am not sure what should I do to fix this problem. Any ideas?

controlled
  • 211
  • 1
  • 2
  • 6
  • one might be native python that comes with your OS. if so, you'd want to leave it alone – pylang Feb 02 '18 at 19:00
  • Possible duplicate of [How to uninstall Python 2.7 on a Mac OS X 10.6.4?](https://stackoverflow.com/questions/3819449/how-to-uninstall-python-2-7-on-a-mac-os-x-10-6-4) – Tiago Martins Peres Feb 02 '18 at 19:04
  • `/Users/myname` is your personal home directory, which is distinct from the system-wide installation belonging to `root` or some similar system account in `/usr/local/bin`. No other user has access to your files, and you should basically be able to remove everything in your home directory without affecting any system-wide functionality. (I don't particularly recommend doing that; definitely don't!) – tripleee Feb 02 '18 at 19:34
  • How did you install those libraries? One via `homebrew` and the other downloading from official Python site? – gonczor Feb 02 '18 at 21:09

0 Answers0