PermissionError: [Errno 13] Permission denied: 'Pipfile' for pipenv install requests

前端 未结 2 777
借酒劲吻你
借酒劲吻你 2021-01-06 09:58

I\'m trying to follow this guide on pipenv and virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/ . The problem is, I run into a problem when trying to

2条回答
  •  日久生厌
    2021-01-06 10:42

    Make sure you've added the UserBase's bin directory to your path (follow the Note box at the documentation you were following to see how to do this).

    The third command you mentioned should just be: pipenv install requests.


    Longer version:

    I'll go a little more in depth for some of the command line concepts since you're getting started with the command line (and for others who would like a little more in depth reference).

    You show three commands:

    • pip3 install --user pipenv
    • This is perfect, it installs pipenv as a user package (not avalible to the entire system)
    • python3 -m pipenv
    • This doesn't do anything. What you see returned is a "Usage message". It's saying this command expects some main.py program, options (optional because in parenthesis), a command (mandatory) and potentially more arguments. If you see a usage message it means you did not call that program the way its author intended.
    • python3 -m pipenv install requests
    • This should just be pipenv install requests. But it won't work until you've added UserBase's bin to your path (you'll get a pipenv: command not found error).

    Your PATH is where your shell will search for the command you've listed. See changing your path on Mac or Linux or Windows.

    As the documentation you were following mentions, you want to run python3 -m site, you'll get output something like the following:

    $ python -m site
      .
      .
      .
    USER_BASE: '/Users//Library/Python/3.6' (exists)
    USER_SITE: '/Users//Library/Python/3.6/lib/python/site-packages' (exists)
    ENABLE_USER_SITE: True
    

    Now that you know where your USER_BASE is, add a /bin onto the end and add it to your PATH. Again see OS specific instructions but on OSX you can add export PATH="$PATH:/Users//Library/Python/3.6/bin to your ~/.profile, run source ~/.profile, and your shell will now search that directory when you enter the command pipenv.

提交回复
热议问题