joeyespo / grip

Preview GitHub README.md files locally before committing them.
MIT License
6.45k stars 423 forks source link

Error in instaling grip. Permission denied on the docopt.py file #269

Closed adderall-prozac closed 6 years ago

adderall-prozac commented 6 years ago

Ran the pip command on Terminal and got this for an error


Installing collected packages: docopt, Werkzeug, click, itsdangerous, Flask, Markdown, path-and-address, grip
  Running setup.py install for docopt ... error
    Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-BqfoZD/docopt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-rl8PrN-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    copying docopt.py -> build/lib
    running install_lib
    copying build/lib/docopt.py -> /usr/lib/python2.7/site-packages
    error: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/docopt.py'

    ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-BqfoZD/docopt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-rl8PrN-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-BqfoZD/docopt/

Is there another way to install? is there something wrong with the docopt.py file?

gh640 commented 6 years ago

I'm not a maintainer of this repo but I believe I can help.

As the error message says, copying the file docopt.py from build/lib/docopt.py to /usr/lib/python2.7/site-packages/docopt.py has failed. This is because the account with which you executed the installation command doesn't have the write permission on /usr/lib/python2.7/site-packages. This issue is not specific to Grip package.

I don't know well of your system and I'm not sure which approach is the best to address the issue. But here are common solutions.

In most cases, b) is better, I believe.

I hope this helps.

joeyespo commented 6 years ago

Thanks for jumping in, @gh640 😃

I'm going to close this since a) and b) from above are both very good approaches. #146 might be the same issue you're seeing. If you feel uncomfortable using sudo, try opening an issue with pip about that behavior.

adderall-prozac commented 6 years ago

Hi guys, Weird I didn't get notified by this.

Thanks I just used sudo instead and it worked. This does seem to be closer to a pip issue than a grip issue.

I hope I get a grip on this. (Apologies for the bad pun)

gh640 commented 6 years ago

Glad to hear you solved it 😃