Michael Boles
Michael Boles

Reputation: 369

Import Python package from new environment: module not found error

I installed Cartopy in a new conda environment new_env because I was unable to install it in my base environment.

I'm now trying to import cartopy in Jupyter Lab and am seeing ModuleNotFoundError: No module named 'cartopy'.

What could be preventing me from importing this package?

I've confirmed cartopy shows up when I conda activate new_env and type conda list, so it's there.

I've also added the corresponding path export PATH="$/opt/anaconda3/envs/new_env/bin:$PATH", so Python should know where to pull packages from.

Any idea how to resolve this? Thanks.

Upvotes: 0

Views: 707

Answers (1)

Ice
Ice

Reputation: 462

In Jupyter notebook, python venv is not activated by conda activate command. This link https://janakiev.com/blog/jupyter-virtual-envs/ will help you.

Upvotes: 1

Related Questions