0
votes

I tried using pip install sendgrid, but got this error:

Collecting sendgrid Using cached https://files.pythonhosted.org/packages/24/21/9bea4c51f949497cdce11f46fd58f1a77c6fcccd926cc1bb4e14be39a5c0/sendgrid-5.6.0-py2.py3-none-any.whl Requirement already satisfied: python-http-client>=3.0 in /home/avin/.local/lib/python2.7/site-packages (from sendgrid) (3.1.0) Installing collected packages: sendgrid Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/sendgrid-5.6.0.dist-info' Consider using the --user option or check the permissions.

I used the --user as suggested and it run ok:

Collecting sendgrid Using cached https://files.pythonhosted.org/packages/24/21/9bea4c51f949497cdce11f46fd58f1a77c6fcccd926cc1bb4e14be39a5c0/sendgrid-5.6.0-py2.py3-none-any.whl Requirement already satisfied: python-http-client>=3.0 in /home/avin/.local/lib/python2.7/site-packages (from sendgrid) (3.1.0) Installing collected packages: sendgrid Successfully installed sendgrid-5.6.0

However, now, when running IPython, I can't import sendgrid...

ImportError: No module named sendgrid

pip -V = pip 19.0.3

2

2 Answers

2
votes

This is a very useful command pip install --ignore-installed <package>
It will make your life easy :)

0
votes

Solved.

It required another package that I missed: pip install python-HTTP-Client.

After that I no longer needed the --user and the imports worked fine