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?
Rohit Patel
Looks like your user doesn’t have the permission to install packages in your system (for all users). Here’s how to fix this problem for Linux, macOS and Windows.
Linux / macOS
From your terminal, you can install the package for your user only, like this:
OR
You can use
su
orsudo
from your terminal, to install the package asroot
:Windows
From the Command Prompt, you can install the package for your user only, like this:
OR
You can install the package as Administrator, by following these steps:
Run This Program As An Administrator
pip install <package>