0

I'm trying to install nltk package to my Python2.7, but I've been having some trouble. I checked other pages already but didn't seem to work for me.

When I try to install nltk, I receive a message saying:

Could not find a version that satisfies the requirement nltk (from    versions: )
No matching distribution found for nltk

Which led me to use:

curl https://bootstrap.pypa.io/get-pip.py | python

Then it seemed to work, but then I get permission error [Errno13]:

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the `--user` option or check the permissions.

So I tried giving sudo chmod 700 and 770 to the directory file, but kept getting the same permission error. I feel like I am missing something. Any help would be appreciated!

Vinci
  • 365
  • 1
  • 6
  • 16
  • try `pip install --upgrade pip` before your `pip install nltk` – gogaz Aug 24 '18 at 16:43
  • @gogaz I tried sudo curl https://bootstrap.pypa.io/ez_setup.py | python'but it gives me permission errno13. I tried changing permission by chmod 770, but it doesn't seem to work. Shouldn't 700 already give me access to the folder? – Vinci Aug 24 '18 at 16:59
  • 1
    do `| sudo python` instead. But don't blame me if it messes your system up – gogaz Aug 24 '18 at 17:00
  • 1
    Can do `sudo pip install ...` as well. But you should do `brew install python` so you're not messing with your system python. – nbwoodward Aug 24 '18 at 17:01
  • Or install the python.org installer. Or use Anaconda. Apple used to provide a great system installation of Python, but they haven't stayed up to date, and it's a mess nowadays, and their security changes to prevent even root from changing certain permissions have made it even more of a mess. – abarnert Aug 24 '18 at 17:31

1 Answers1

1

Your problem is you are trying to add a package to the system python. Many Mac users install python with homebrew so that they are not changing their system python configuration. This SO has a good description of python on OSX/Macos:

What should be my python packages path for a user install on MacOS?

nbwoodward
  • 2,816
  • 1
  • 16
  • 24