Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import problem #16

Closed
vezeli opened this issue Apr 19, 2019 · 2 comments
Closed

import problem #16

vezeli opened this issue Apr 19, 2019 · 2 comments
Labels

Comments

@vezeli
Copy link

vezeli commented Apr 19, 2019

Hey!

Thanks for all your hard work on this open project!

I have a problem with importing proplot on my Ubuntu 18. In README you mentioned that cartopy is used for optional geographic mapping features so I am assuming cartopy is an optional dependency. However, I have a problem with import proplot and this is the error ModuleNotFoundError: No module named 'cartopy' also I have matplotlib and numpy installed. Is this behavior a bug or am I missing something?

Here is the results of import:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-41f69010d0c1> in <module>()
----> 1 import proplot as plot

/home/vezeli/.local/lib/python3.6/site-packages/proplot/__init__.py in <module>()
     10 from .rcmod import *      # custom configuration implementation
     11 from .utils import *      # misc stuffimport cartopy
---> 12 from .axes import *       # everything, axes definitions
     13 from .subplots import *
     14 from .gridspec import *

/home/vezeli/.local/lib/python3.6/site-packages/proplot/axes.py in <module>()
     81 # TODO: Import matplotlib docstring func, use it?
     82 from .rcmod import rc, _rc_names_nodots
---> 83 from . import utils, projs, colortools, fonttools, axistools
     84 from .utils import _default, _timer, _counter, ic, units
     85 from .gridspec import FlexibleGridSpec, FlexibleGridSpecFromSubplotSpec

/home/vezeli/.local/lib/python3.6/site-packages/proplot/projs.py in <module>()
     77 import matplotlib.path as mpath
     78 import warnings
---> 79 import cartopy
     80 from .rcmod import rc
     81 try:

ModuleNotFoundError: No module named 'cartopy'

Since the problem is in line #79 import cartopy in projs.py I tried moving this line inside the try environment in #81 but this didn't solve my problem. Any suggestions on how to import proplot successfully?

@lukelbd
Copy link
Collaborator

lukelbd commented Apr 20, 2019

...wow I have no idea why/when I added that line. Whoops. Does the latest commit (2ae8fe5) fix it? You should be able to update by running:

pip install git+https://github.com/lukelbd/proplot.git#egg=proplot --upgrade

@vezeli
Copy link
Author

vezeli commented Apr 20, 2019

Patch 2ae8fe5 fixed it. I tested import proplot as plot in the regular jupyter notbook and it runs smoothly but when I tested in Ipython there is an issue with the %autosave since I have an old version of Ipython 5.5.0 installed and it does not support %autosave magic function. However, I could solve the problem by changing the nbsetup variable in .proplotrc to False.

Thanks for the help @lukelbd !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants