0

I want to install pip3 install twint but I get the error:

ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.8'
Consider using the `--user` option or check the permissions.

what command do i need to type to install it under my user option? would it be python -m pip3 install twint?

smci
  • 32,567
  • 20
  • 113
  • 146
  • run as administrator, if you are on a Mac, prefix by sudo – Weilory Sep 06 '20 at 04:27
  • Not clear how you installed python3, but /Library requires elevated permission – OneCricketeer Sep 06 '20 at 13:55
  • Does this answer your question? [Could not install packages due to an EnvironmentError: \[Errno 13\]](https://stackoverflow.com/questions/52949531/could-not-install-packages-due-to-an-environmenterror-errno-13) – Gino Mempin Sep 06 '20 at 13:58
  • 1
    `sudo` is the solution, insofar as it allows you to do something you probably should not be doing. If any *system* tools needed `twint`, it would come with the system or be pushed as an update from Apple. Don't modify the *system* installation because *you* need a particular module. – chepner Sep 06 '20 at 14:12
  • I added the tags [tag:macos], [tag:macos-catalina], [tag:installation]. For most MacOS issues, look also at solutions for previous releases. – smci Oct 11 '20 at 20:31
  • @chepner: sudo is generally **not** the solution, it only pushes the original problem (installing Python as administrator,) further around. – smci Oct 11 '20 at 20:51
  • Did you install Python while logged in as administrator (e.g. with Anaconda)? That's generally a bad idea (both on Windows and MacOS) and causes permissions issues like this when installing packages. – smci Oct 11 '20 at 20:52
  • @smci That's why I said "don't modify the system installation". – chepner Oct 11 '20 at 20:53
  • @chepner: no that's different again. I don't believe the OP is referring to the system installation which on MacOS is under `/usr/bin/python` and also it doesn't come with `pip` installed, so not likely what they're asking about. I'm talking about third-party Python installs (`/usr/local/bin/python`, Homebrew path, Anaconda: `/opt/your_path_goes_here/python`, etc.) It is possible to install them as administrator, and that's generally a bad idea. – smci Oct 11 '20 at 20:59

2 Answers2

1

as suggested by pip, use --user: python3 -m pip install --user twint

it will install your package in your home (https://pip.pypa.io/en/stable/user_guide/#user-installs)

as a better alternative, you can look into virtual environments

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Cyril Jouve
  • 990
  • 5
  • 15
0

Try installing this using the Anaconda Navigator cmd. The installation did not work in Jupyter Notebook, but it did work in Anaconda Navigator cmd.

Zane Cantrell
  • 247
  • 3
  • 9