[pyngl-talk] Help with PyNIO installation

Fan, Xingang xingang.fan at wku.edu
Fri Dec 16 13:56:02 MST 2016


Hi, Bill and Kevin:

Good news! Finally, I got an environment that works! (before update Xcode)

The following was what I did:

bash Downloads/Anaconda2-4.2.0-MacOSX-x86_64.sh<http://anaconda2-4.2.0-macosx-x86_64.sh/>
conda update conda
conda update -all

conda create -n metuse python=2.7 spyder basemap netcdf4
source activate metuse
conda install -c ncar -c khallock pynio pyngl

I have tested that PyNio, PyNGL, and basemap all works in both python and spyder. No problem, no warnings, etc.

Thanks for still keeping the versions at channels of ncar and khallock!
The previous many tries somehow show that conda-forge is against me for now. With conda-forge, I tried only pynio and pyngl, no luck. I tried only pygrib, no luck. Spyder was also downgraded to 2.3.9. Pygrib is still not working, even when I downloaded the zip file and install with pip. But, with pynio, I think can get around it for grib files.

Thank you for all your time, and again your great patience!
Also thanks for the reminder of updating Xcode, I did that after the above worked. I guess it will be helpful in the long run.

I sincerely wish you happy holidays!
Xingang

From: Bill Ladwig <ladwig at ucar.edu<mailto:ladwig at ucar.edu>>
Date: Friday, December 16, 2016 10:42 AM
To: Xingang Fan <xingang.fan at wku.edu<mailto:xingang.fan at wku.edu>>
Cc: Kevin Hallock <hallock at ucar.edu<mailto:hallock at ucar.edu>>, "pyngl-talk at ucar.edu<mailto:pyngl-talk at ucar.edu>" <pyngl-talk at ucar.edu<mailto:pyngl-talk at ucar.edu>>
Subject: Re: [pyngl-talk] Help with PyNIO installation

Hi Xinygang,

The error message is indicating that you are missing __sincos_stret, which is probably something that is assumed to be on your Mac already, since it is associated with the compiler math libraries.  Can you try installing (or reinstalling) XCode and the command line tools to see if that fixes your problem.  I know Apple just released an XCode update, and sometimes libraries need to get reinstalled manually after the update, usually via installing the command line tools.  (Run "xcode-select --install" and see if it prompts you to install the tools).

If not, what version of OSX are your running?  Can you run this command:

otool -L /Users/xng02546/anaconda2/envs/pyncar/lib/python2.7/site-packages/PyNIO/nio.so

Can you reply with the result of this command?  I think that missing library is supposed to be in libSystem.B.dylib, but we'll have to see what otool says to try to figure out the problem.

Thanks,

Bill


On Thu, Dec 15, 2016 at 10:49 PM, Fan, Xingang <xingang.fan at wku.edu<mailto:xingang.fan at wku.edu>> wrote:
I tried a simpler installation, and still has problems as below. Do you know if any hidden cache might be left in my Mac home account that might cause problems? Since I installed Enthought Canopy in my home directory too (before my old working anaconda), when I was cleaning up anaconda installations, I was afraid I might delete something belongs to Canopy. But I did remove the anaconda entire folder.

conda create -n pyncar -c conda-forge pynio pyngl
Source activate pyncar

(pyncar) FXG-MacBook:~ xng02546$ python
Python 2.7.12 | packaged by conda-forge | (default, Sep  8 2016, 14:41:48)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import Nio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xng02546/anaconda2/envs/pyncar/lib/python2.7/site-packages/PyNIO/Nio.py", line 83, in <module>
    from nio import *
ImportError: dlopen(/Users/xng02546/anaconda2/envs/pyncar/lib/python2.7/site-packages/PyNIO/nio.so, 2): Symbol not found: ___sincos_stret
  Referenced from: /Users/xng02546/anaconda2/envs/pyncar/lib/libgdal.20.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/xng02546/anaconda2/envs/pyncar/lib/libgdal.20.dylib
>>> import Ngl
>>> print Ngl.__version__
1.5.0_beta20161122
>>> print Nio.__version__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Nio' is not defined
>>>

From: Xingang Fan <xingang.fan at wku.edu<mailto:xingang.fan at wku.edu>>
Date: Thursday, December 15, 2016 11:18 PM
To: Kevin Hallock <hallock at ucar.edu<mailto:hallock at ucar.edu>>
Cc: "pyngl-talk at ucar.edu<mailto:pyngl-talk at ucar.edu>" <pyngl-talk at ucar.edu<mailto:pyngl-talk at ucar.edu>>, Bill Ladwig <ladwig at ucar.edu<mailto:ladwig at ucar.edu>>

Subject: Re: [pyngl-talk] Help with PyNIO installation

Dear Kevin and Bill:

I really appreciate your patience with me and help. I am kind of new to the python packages and just don't know how to interpret the error messages.
The following was what I did, considering your suggestions:

FIRST:
Deleted the anaconda2 directory along with .conda .condrc
Reinstalled anaconda2: bash Downloads/Anaconda2-4.2.0-MacOSX-x86_64.sh<http://Anaconda2-4.2.0-MacOSX-x86_64.sh>
condo update condo
conda update -- all

With these, python and spyder (newest version) starts well.

THEN:
conda config --add channels conda-forge        # This makes the installation to search packages first from conda-forge #
conda create -n test -c conda-forge pynio pyngl netcdf4 basemap spyder
source activate test
python Downloads/Basemaps_US_01.py

TESTING RESULTS:
spyder (2.3.9) starts well, but running one of my code (tested okay in earlier installations) had problems with either matplotlib or basemap. So, I also run it from command line.
The problems are shown below. Right following it, is the attempt to import Nio directly from running python at command line:

(test) FXG-MacBook:~ xng02546$ python Downloads/Basemaps_US_01.py
Traceback (most recent call last):
  File "Downloads/Basemaps_US_01.py", line 1, in <module>
    from mpl_toolkits.basemap import Basemap
  File "/Users/xng02546/anaconda2/envs/test/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py", line 28, in <module>
    from matplotlib.collections import LineCollection, PolyCollection
  File "/Users/xng02546/anaconda2/envs/test/lib/python2.7/site-packages/matplotlib/collections.py", line 24, in <module>
    import matplotlib.transforms as transforms
  File "/Users/xng02546/anaconda2/envs/test/lib/python2.7/site-packages/matplotlib/transforms.py", line 39, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: dlopen(/Users/xng02546/anaconda2/envs/test/lib/python2.7/site-packages/matplotlib/_path.so, 2): Symbol not found: ___sincos_stret
  Referenced from: /Users/xng02546/anaconda2/envs/test/lib/python2.7/site-packages/matplotlib/_path.so
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/xng02546/anaconda2/envs/test/lib/python2.7/site-packages/matplotlib/_path.so

(test) FXG-MacBook:~ xng02546$ which python
/Users/xng02546/anaconda2/envs/test/bin/python

(test) FXG-MacBook:~ xng02546$ python
Python 2.7.12 | packaged by conda-forge | (default, Sep  8 2016, 14:41:48)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Nio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xng02546/anaconda2/envs/test/lib/python2.7/site-packages/PyNIO/Nio.py", line 83, in <module>
    from nio import *
ImportError: dlopen(/Users/xng02546/anaconda2/envs/test/lib/python2.7/site-packages/PyNIO/nio.so, 2): Symbol not found: ___sincos_stret
  Referenced from: /Users/xng02546/anaconda2/envs/test/lib/libgdal.20.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/xng02546/anaconda2/envs/test/lib/libgdal.20.dylib
>>> import Ngl
>>>

Thanks,
Xingang

P.s.  I had a successful installation before on this computer. It was messed up when I tried to update the pyngl and pynio from condo-forge. However, I forgot how I installed them the first time. I might have installed from downloading the .zip files from Github and then use pip. The only thing I didn't have was pygrib. This was the reason why I attempted to update my previous working system (all under root env), because on a Ubuntu virtual machine system, all three of pyngl pynio and pygrib were successfully installed and can be imported without problem. While keep trying an easy install, I will see if I can repeat my old installation.

I really need an easy procedure, so that the students would be able to follow on their own Mac system. For Windows machine, the virtual machine I created can be imported into their VirtualBox.

Thanks again for your help!



From: Kevin Hallock <hallock at ucar.edu<mailto:hallock at ucar.edu>>
Date: Thursday, December 15, 2016 1:14 PM
To: Xingang Fan <xingang.fan at wku.edu<mailto:xingang.fan at wku.edu>>
Cc: "pyngl-talk at ucar.edu<mailto:pyngl-talk at ucar.edu>" <pyngl-talk at ucar.edu<mailto:pyngl-talk at ucar.edu>>
Subject: Re: [pyngl-talk] Help with PyNIO installation

Hi Xingang,

(I) At Conda root, I ran:
    conda create -n metuse -c conda-forge pynio pyngl
    source activate met use

(II) From root, I created a new environment condaX by:
     Conda create –n condaX python=2.7 anaconda
     Source activate condaX
     Conda install netcdf4
     Conda install basemap
     Conda update --all

(III) Based on the working condoX environment, I tried to clone it, then wanted to install pyNGL etc.,
     The cloned environment has same results from conda list,
     Running python, it imports matplotlib and basemap okay,
     But, somehow, spyder won't start, it shows the following message:

Instead of creating these two separate environments and then trying to combine them, could you please try creating a single environment using the following command:
conda create -n pyn_testing -c conda-forge python=2.7 pynio pyngl netcdf4 basemap spyder
source activate pyn_testing

Even though both of the environments work before combining them, I would expect them to fail due to incompatible versions of packages. For example, in your “metuse” environment you should have libnetcdf 4.4.1.1 from conda-forge installed as a dependency of pynio; in your “condaX” environment, you’ll have libnetcdf 4.4.1 from the default channel installed as a dependency of netcdf4. This is just one example of the incompatibilities that can happen when installing from multiple channels. Again, it is important to use “-c conda-forge” on any “conda create …”/“conda install …”/“conda update …” commands you may run for the environment you’re trying to create.

Also, I noticed that you chose to install the anaconda package when creating the condaX environment (in step II above). Installing the “anaconda” package is almost guaranteed to make your environment incompatible with most packages from the conda-forge channel (including pynio and pyngl), as described in the previous paragraph. Is there a particular package included in “anaconda” that you need? I would try to list specific packages instead of “anaconda”, and I would try to install them from the conda-forge channel (“-c conda-forge”) if possible.

I hope this helps!

Kevin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20161216/559b6cdd/attachment-0001.html 


More information about the pyngl-talk mailing list