Pip / boto problems - ImportError: No module named boto3
Probably, the best way to deal with multiple python versions is to isolate them using virtualenv
This article covers it's basics and would give you a good overview http://docs.python-guide.org/en/latest/dev/virtualenvs/
Related videos on Youtube
SPRBRN
Updated on September 18, 2022Comments
-
SPRBRN over 1 year
I want to get boto3 working in a python3 script. I can execute aws commands from the cli.
After updating pip, it doesn't run with sudo rights unless I use the absolute path:
/usr/local/bin/pip
. Without sudo rights it works. I have no idea why it doesn't run under sudo, which it did before updating, as/usr/local/bin
is in PATH.Should I run pip under sudo or not?
I installed boto3, but still get
ImportError: No module named 'boto3'
. This is when I execute a script that runs python3. But it seems that boto3 is installed for python2.
Output:
$ sudo /usr/local/bin/pip install --upgrade boto3 Requirement already up-to-date: boto3 in /usr/local/lib/python2.7/site-packages
How do I get boto3 working with python3?
-
SPRBRN over 8 yearsThanks. That fixes question 3. I still have to use the absolute path for pip, but that's not a major problem. And I'm still wondering whether to run pip as root or not.
-
Serhii Balbieko over 8 yearsvirtualenv by default lets you run it as regular user, as it installs packages inside an env and accessible for your current user