Solution:
In case you want to employ python3+ to install the packages you require to use pip3 install packageName
And to solve the errno 13 you have to include --user
at the end
pip3 install packageName --user
EDIT:
For any project in python it's immensely recommended to perform on a Virtual enviroment, is a tool that helps to keep dependencies necessary by diverse projects separate by making isolated python virtual environments for them.
In order to make one with python3+ you have to employ the following command:
virtualenv enviroment_name -p python3
And then you perform on it only by activating it:
source enviroment_name/bin/activate
At one time the virtual environment is activated, the name of your virtual environment will seem on left side of terminal. This will let you know that the virtual environment is presently active. At present you can install dependencies related to the project in this virtual environment by only employing pip
.
pip install package_name
Concerning the permissions command, attempt employing sudo in front of your terminal command:
sudo pip install --upgrade pip
Sudo is a program that approves you to run the command with the privileges of the superuser.
Regarding the python attempt running pip as an executable like this:
python3.6 -m pip install <package>
I obtain the similar error at the time I was attempting to install a package (flask-classful).
I created the mistake of installing anaconda as root. I altered the ownership of the installed anaconda folder and I could install the package successfully.
Employ the command chown
with option -R
to recursively alter ownership of the installed anaconda folder like so:
chown -R owner:group /path/to/anaconda
The answer is in the error message. In the former you or a process did a sudo pip
and that happened some of the directories under /Library/Python/2.7/site-packages/...
to have permissions that make it unaccessable to your immddiate user.
Thereafter you did a pip install whatever
which dependencies on the other thing.
Or you can employ pip install's --user
option to install packages into your home directory where you have all necessary permissions. For example
pip install myPackage --user
Do not forget to include the install directory in your home to PATH environment variable.