HI I am trying to run my python codes from EC2 server. the connection and all has been completed so that works fine. however when I try and run a code it gave me an error
ImportError: No module named 'matplotlib'
Tried to install matplotlib using pip install matplotlib but I get an error ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/dateutil'
Consider using the `--user` option or check the permissions.
1 Answer
pip defaults to installing Python packages to a system directory (such as /usr/local/lib/python3.4). This requires root access.
--user makes pip install packages in your home directory instead, which doesn't require any special privileges.
4 Comments
TRex
thanks @hithyshi, that was helpful. I tried downloading using
sudo pip3 --user install matplotlib, but get another error File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main' any idea what's happening here?hithyshi
@PrasKam try this: python3 -m pip install --user "packagename" and let me know
TRex
perfect, thanks @hithyshi, that was very helpful again. its working fine now
TRex
although one issue I just realised is that I don't see my graphs when I run it from the EC2 server. something that you are aware of?
sudo pip install? It works in my case