I installed opencv with all dependencies. After the installation I tried to import matplotlib for a simple example.
Then I got the following error, when I tried to install matplotlib via pip with pip install matplotlib
:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/kiwisolver.cpython-35m-x86_64-linux-gnu.so'
Consider using the `--user` option or check the permissions.
What can I do to install matplotlib?
There might be instances when you keep getting an error “Could not install packages due to an EnvironmentError: [Errno 13] Permission denied” when you pip install. This error comes up because of missing privilege to the directory in which pip is trying to write files.
PIP is automatically installed with Python 2.7.9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments.
Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process.
It looks like your user does not have the permission to install packages in your system (for all users). Here's how to fix this problem for Linux, macOS and Windows.
From your terminal, you can install the package for your user only, like this:
pip install <package> --user
OR
You can use su
or sudo
from your terminal, to install the package as root
:
sudo pip install <package>
From the Command Prompt, you can install the package for your user only, like this:
pip install <package> --user
OR
You can install the package as Administrator, by following these steps:
Run This Program As An Administrator
pip install <package>
I solved this issue by typing the following command,
pip install --user <package_name>
Example,
pip install --user tensorflow
NOTE: You should not enter your own username for this command. Please enter with '--user'.
Try this:
sudo pip install matplotlib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With