I have an anaconda virtual environment set up on a linux box.
The dotenv
module wasn't installed, so I tried to install it. It installed successfully:
(virt_env_01) [jm@etl01 testing]$ conda install -c conda-forge python-dotenv
## Package Plan ##
environment location: /home/jm/anaconda3/envs/virt_env_01
added / updated specs:
- python-dotenv
...
Downloading and Extracting Packages
certifi-2018.4.16 | 142 KB | ############################################### | 100%
python-dotenv-0.8.2 | 18 KB | ############################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
However, when I tried to run the python script using it, I got an error saying no module found.
(virt_env_01) [jm@etl01 testing]$ pytest sql_server_tests.py
platform linux -- Python 3.6.3, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
...
Traceback:
sql_server_tests.py:3: in <module>
import dotenv
ModuleNotFoundError: No module named 'dotenv'
Can someone explain what I've done wrong?
EDIT:
I am running Pytest above. So I tried Python and it works fine. Could pytest be installed outside the virtual environment or something? I don't know how that all works.
The pytest module was out of date.
After I ran conda install pytest
it worked fine.