it is because the python interpreter you use to run your code doesn't have troposphere installed.
Managing multiple Python version on the same computer is tricky, But I will try to explain it.
I assume that you are using python your_script.py
to run your code, and pip install troposphere
to install package right? But think of this, how does your system know exactly which python you are running and which python to install package? Here's how to check the full path of your python command and pip command.
- type
python
command enter python console
- then type this:
import sys
print(sys.executable)
3. navigate up and down little bit, you will find a bin folder include
bin/python
which is your interpreter and
bin/pip
which is your pip command. And there's a
lib/site-packages
folder, this is where third party library been installed to.
4. if you see import error, use the above method to locate the python interpreter and check the site-packages folder, most likely there's no such
troposphere
folder in it. Then you need to use the full path of the
<path-to>/bin/pip
to install troposphere. Then your problem is solved.
If you are using home brew or the python installer download from www.python.org, your system probablly already messed up. The recommended way to manage multiple Python version is to use pyenv https://github.com/pyenv/pyenv. It allows you to install any python version and easy to delete them.