Py-ART import error under Anaconda Python 3.6

595 views
Skip to first unread message

Paul Hein

unread,
Jun 8, 2018, 5:39:00 PM6/8/18
to Py-ART Users
I just installed anaconda python 3.6 on a CentOS 7.5 machine and I used conda to install the modules.  I get an error when I simply type "import pyart".  It looks like the error is due to geos module which I did not install but I think Basemap did need it.  Pyart has almost all the optional dependencies (trmm_rsl, h5py, Basemap, wradlib, nose, gdal).  Cartopy is also installed. Attached is the list of installed modules. I am not finding any answers.  Here is the error:
mycomputer:~$ python
Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyart

## You are using the Python ARM Radar Toolkit (Py-ART), an open source
## library for working with weather radar data. Py-ART is partly
## supported by the U.S. Department of Energy as part of the Atmospheric
## Radiation Measurement (ARM) Climate Research Facility, an Office of
## Science user facility.
##
## If you use this software to prepare a publication, please cite:
##
##     JJ Helmus and SM Collis, JORS 2016, doi: 10.5334/jors.119

/usr/local64/python-3.6/anaconda3/lib/python3.6/site-packages/pyart/config.py:22: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
python: geos_ts_c.cpp:3408: int GEOSCoordSeq_setOrdinate_r(GEOSContextHandle_HS*, geos::geom::CoordinateSequence*, unsigned int, unsigned int, double): Assertion `0 != cs' failed.
Abort (core dumped)

Thank you for your help!
Paul
python36.list

Kai Mühlbauer

unread,
Jun 9, 2018, 1:17:12 AM6/9/18
to Paul Hein, Py-ART Users
Hi Paul,

most likely the problem is due to working in the anaconda root/base environment.

Looking into your package list you can see, that packages from default-channel and conda-forge are mixed. This can lead to the shown behaviour.

Please try to create a dedicated conda environment and install pyart and other needed packages into this environment.

HTH
Kai
--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

Nick Guy

unread,
Jun 11, 2018, 4:11:30 PM6/11/18
to Py-ART Users
Kai is likely correct, but if that doesn't work. In the last 6 months, I've seen instances where the order in which you install gdal is important. This happened during a couple of updates to both gdal and anaconda. At those times, gdal had to be among the first packages installed. It may be sorted by now.
Nick

Scott Collis

unread,
Jun 11, 2018, 4:15:39 PM6/11/18
to Nick Guy, Py-ART Users
Oh yeah.. GDAL plays not nice with NetCDF and HDF5 at times..

I know it is a paradigm shift but using conda environments for packages really helps.. 

Take a look at several I have here:

Py-ART full will give you all you need

Note, read the instructions in the file about setting paths for the LP compile..

Some times csuradartools will fail here on MacOS.. if you get that issue make sure you
conda install gfortran_osx-64
IN YOUR base conda (so start with a source deactivate)



Scott Collis


--
You received this message because you are subscribed to the Google Groups "Py-ART Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyart-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Hein

unread,
Jun 12, 2018, 4:35:06 PM6/12/18
to Py-ART Users
I have been playing around and trying to get it to work, and I have used your pyart_full.yml and I came up with the exact same geos error.  So I am still striking out.  I am wondering if it is the geos module that is the problem since that is what the error shows and not the gdal module. Removing the gdal module does not solve the problem.  The same error is still there. Unfortunately geos module is used by many packages (basemap and cartopy in particular).  What gets loaded is geos 3.6.2.  Removing geos does allow pyart to be imported but that removes too much.    Again this is with CentOS 7.

(By the way, using yml file is a nice way to install.  This was a first for me.  Thanks!)

Kai Mühlbauer

unread,
Jun 12, 2018, 4:54:13 PM6/12/18
to Paul Hein, Py-ART Users
Hi Paul,

Did you install inside a dedicated environment or in the root env? If you've created a new env, can you post the output of 'conda list' from inside the env?

The error you are facing has most likely to do with mixing different channels. To track this down, we need to find which clashes are happening.

Cheers,
Kai

Paul & Gail Hein

unread,
Jun 12, 2018, 5:30:30 PM6/12/18
to Kai Mühlbauer, Py-ART Users
I figured out the problem.  If I import basemap and then import cartopy python crashes with the error.  If I import cartopy and then import basemap there is no error.  So removing module cartopy allows pyart to load with out an error.  Not an ideal solution but it works.  Thank you, everyone!

You received this message because you are subscribed to a topic in the Google Groups "Py-ART Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyart-users/HdLAVVx5XgA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyart-users+unsubscribe@googlegroups.com.

Paul Hein

unread,
Jun 12, 2018, 5:59:10 PM6/12/18
to Py-ART Users
Kai - You are correct.  Cartopy is part of the main distribution and basemap is on the conda-forge channel.  Thanks!  Paul


On Tuesday, June 12, 2018 at 3:30:30 PM UTC-6, Paul Hein wrote:
I figured out the problem.  If I import basemap and then import cartopy python crashes with the error.  If I import cartopy and then import basemap there is no error.  So removing module cartopy allows pyart to load with out an error.  Not an ideal solution but it works.  Thank you, everyone!
On Tue, Jun 12, 2018 at 2:54 PM, Kai Mühlbauer wrote:
Hi Paul,

Did you install inside a dedicated environment or in the root env? If you've created a new env, can you post the output of 'conda list' from inside the env?

The error you are facing has most likely to do with mixing different channels. To track this down, we need to find which clashes are happening.

Cheers,
Kai

Scott Collis

unread,
Jun 12, 2018, 6:00:55 PM6/12/18
to Paul Hein, Py-ART Users
Yup.. That’l do it!

Tip: 
Import SOME_PACKAGE
print(SOME_PACKAGE.__file__)



Scott Collis

Kai Mühlbauer

unread,
Jun 13, 2018, 12:56:37 AM6/13/18
to Paul Hein, Py-ART Users
Hey Paul,

glad you got it working!

Cheers,
Kai
Reply all
Reply to author
Forward
0 new messages