1

I am attempting to import cartopy into a notebook but am running into issues. If I do a "conda install cartopy" in my base environment, I get the frozen/flexible solve issue (https://github.com/conda/conda/issues/9367). When I open a new environment and do a "conda install cartopy", it seems like everything works. "conda list" shows version 0.18.0 in that environment. Then I open a Jupyter Notebook from within that environment and try to import it into the notebook but originally got the response "no module named cartopy". I tried fiddling with my environments and settings based on feedback on this page (In which conda environment is Jupyter executing?), but now the error is "no module named numpy"! Can someone please help me understand why the notebook isn't seeing these modules? Thank you.

mdflournoy
  • 11
  • 1
  • I have issues with conda and jupyter as well every once in a while. My experience is that sometimes you open a notebook inside an environment, but then the notebook is not actually opened from that environment. For me it's usually because the environment doesn't contain jupyter, but my general conda does. It then just semi-silently opens jupyter from outside of your environment. – KenHBS Sep 10 '20 at 17:16

1 Answers1

0

Are you certain that numpy is installed in this new environment?

Given that you are using the Anaconda distribution of Python, you should be able to view/configure your environment and it's installed modules using the Anaconda Navigator. Here you can see a full list of all installed modules, and via the terminal/console, launch a Jupyter Notebook from not only within a specific environment, but within a specific directory!

Opening a Terminal from a Specific Environment

On the left hand side, you can choose the environment that you want to use to start Jupyter Notebook, and on the right you can view all of the installed modules in that environment. Make sure that jupyter, numpy, and cartopy are all listed as installed packages.

To make sure that I am launching Jupyter from my desired environment, I always launch it directly from the terminal. I "Open Terminal" with my environment, "cd" into the directory that I want to use, and then use the jupyter notebook or jupyter lab command.

NolantheNerd
  • 338
  • 3
  • 10
  • Thank you. Actually, I think I solved it by fiddling around some more. There may be a thread on this already, but Python 3.8 appears to be the issue. If I open a new environment with Python 3.7, I am able to install cartopy and jupyter, open a notebook, and import cartopy with no problems. – mdflournoy Sep 10 '20 at 18:19