Reputation: 12837
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
Upvotes: 1
Views: 2252
Reputation: 119
I know this is old, but this post kept popping up while I was searching for the same issue. Sendgrid was working for me, but then it stopped for some reason. I was using Windows and VS Code. I've spent hours trying to pip uninstall and install it and its dependencies over and over again. Eventually did the below and it got resolved. Hope to save someone else some time:
git clone https://github.com/sendgrid/sendgrid-python.git
cd sendgrid-python
python setup.py build
python setup.py install
Upvotes: 0
Reputation: 105
This is a very useful command pip install --ignore-installed <package>
It will make your life easy :)
Upvotes: 2
Reputation: 12837
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
Upvotes: 1