ARM-DOE / pyart

The Python-ARM Radar Toolkit. A data model driven interactive toolkit for working with weather radar data.
https://arm-doe.github.io/pyart/
Other
516 stars 268 forks source link

Installation on Ubuntu with Canopy #215

Closed rvalenzuelar closed 9 years ago

rvalenzuelar commented 9 years ago

I followed the installation instructions:

$ python setup.py build
$ sudo python setup.py install

...but then I get:

Traceback (most recent call last):
  File "setup.py", line 180, in <module>
    setup_package()
  File "setup.py", line 162, in setup_package
    from numpy.distutils.core import setup
ImportError: No module named numpy.distutils.core

I'm using Ubuntu 14.04 LTS.

scollis commented 9 years ago

Could you please type: which python

And send the output

-sent from a mobile device-

On Dec 15, 2014, at 6:19 PM, Raul Valenzuela notifications@github.com wrote:

I followed the installation instructions:

$ python setup.py build $ sudo python setup.py install ...but then I get:

Traceback (most recent call last): File "setup.py", line 180, in setup_package() File "setup.py", line 162, in setup_package from numpy.distutils.core import setup ImportError: No module named numpy.distutils.core I'm using Ubuntu 14.04 LTS.

— Reply to this email directly or view it on GitHub.

rvalenzuelar commented 9 years ago

/home/raul/Enthought/Canopy_32bit/User/bin/python

Thanks.

jjhelmus commented 9 years ago

@rvalenzuelar Do you have the Canopy version of NumPy installed? Py-ART needs this package for installation and at run-time. You can check if NumPy is available and what version is installed by executing the following in a terminal window.

python -c "import numpy; print(numpy.__version__)"
rvalenzuelar commented 9 years ago

After typing that command I get:

1.8.1
jjhelmus commented 9 years ago

How about

python -c "from numpy.distutils.core import setup"

Does that give the same ImportError or does it succeed?

Also is this Python 2 or 3, python --version should give you the full version.

rvalenzuelar commented 9 years ago

The output of the command is similar:

Traceback (most recent call last):
File "string", line 1, in <module>
ImportError: No module named disutils.core

And the version is:

Python 2.7.6 -- 32 bit
jjhelmus commented 9 years ago

Make sure you have a t in distutils, from the error it looks like it was left out. I don't typically run on 32-bit Python, let me create a VM and try to reproduce the error.

rvalenzuelar commented 9 years ago

Sorry, you are right. I run the same command with the t and I get no error message.

jjhelmus commented 9 years ago

Wait, does the error message get printed after the sudo python setup.py install command? If so the issue is that the superuser has a different Python environment. Try removing the sudo, which should work if you have write access to the site-packages directory somewhere in /home/raul/Enthought/Canopy_32bit/User. If that does not work python setup.py install --user to do a user install into /home/raul/.local/ .

rvalenzuelar commented 9 years ago

Ok, I tried:

$ python setup.py install

and I got:

pyart/io/setup.py:70: UserWarning: 
==============================================================================
WARNING: RSL LIBS AND HEADERS COULD NOT BE FOUND AT THE PROVIDED LOCATION.

Py-ART will be build without bindings to the NASA TRMM RSL library but some
functionality will not be available.  If this functionality is desired please
rebuild and reinstall Py-ART after verifying:

    1. The NASA TRMM RSL library is installed and accessable.  This package
       can be obtained from:
            http://trmm-fc.gsfc.nasa.gov/trmm_gv/software/rsl/.

    2. The RSL_PATH environmental variable points to where RSL is installed
       (the libs in $RSL_PATH/lib, the headers in $RSL_PATH/include).
       Currently the RSL_PATH variable is set to: /usr/local/trmm

==============================================================================

  warnings.warn(RSL_MISSING_WARNING % (rsl_path))
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "pyart.io._sigmetfile" sources
building extension "pyart.map.ball_tree" sources
building extension "pyart.map.ckdtree" sources
building extension "pyart.map._load_nn_field_data" sources
building extension "pyart.retrieve._echo_steiner" sources
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using config
Fortran f77 compiler: /usr/bin/gfortran -Wall -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran f90 compiler: /usr/bin/gfortran -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran fix compiler: /usr/bin/gfortran -Wall -ffixed-form -fno-second-underscore -Wall -fno-second-underscore -fPIC -O3 -funroll-loops
compile options: '-c'
gfortran:fix: _configtest.f90
success!
removing: _configtest.f90 _configtest.o
  adding 'pyart/retrieve/_echo_steiner.pyf' to sources.
  adding 'pyart/retrieve/src/echo_steiner.f90' to sources.
f2py options: []
  adding 'build/src.linux-i686-2.7/fortranobject.c' to sources.
  adding 'build/src.linux-i686-2.7' to include_dirs.
building data_files sources
build_src: building npy-pkg config files
running build_py
copying pyart/version.py -> build/lib.linux-i686-2.7/pyart
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize Gnu95FCompiler
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
running build_scripts
running install_lib
copying build/lib.linux-i686-2.7/pyart/version.py -> /home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pyart
byte-compiling /home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pyart/version.py to version.pyc
running install_scripts
changing mode of /home/raul/Enthought/Canopy_32bit/User/bin/anytocfradial to 775
changing mode of /home/raul/Enthought/Canopy_32bit/User/bin/radar_plot to 775
changing mode of /home/raul/Enthought/Canopy_32bit/User/bin/check_cfradial to 775
changing mode of /home/raul/Enthought/Canopy_32bit/User/bin/radar_info to 775
running install_data
running install_egg_info
Removing /home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pyart-0.0.0-py2.7.egg-info
Writing /home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pyart-0.0.0-py2.7.egg-info
running install_clib
customize UnixCCompiler

I have nose installed in Canopy, so I run the nosetests from outside the source directory :

~/Github$ nosetests --exe pyart/

and I get:

E
======================================================================
ERROR: Failure: ImportError (No module named _sigmetfile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/nose/loader.py", line 414, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/raul/Github/pyart/pyart/__init__.py", line 13, in <module>
    from . import io
  File "/home/raul/Github/pyart/pyart/io/__init__.py", line 34, in <module>
    from .sigmet import read_sigmet
  File "/home/raul/Github/pyart/pyart/io/sigmet.py", line 26, in <module>
    from ._sigmetfile import SigmetFile, bin4_to_angle, bin2_to_angle
ImportError: No module named _sigmetfile

----------------------------------------------------------------------
Ran 1 test in 0.137s

FAILED (errors=1)
jjhelmus commented 9 years ago

The tests cannot be run from the source directory (there is an outstanding bug report to fix this). If you change to a new directory (cd ~ will work), you should be able to run the tests with the same command.

rvalenzuelar commented 9 years ago

Ok, I tried:

~$ nosetests --exe pyart

and I get:

E
======================================================================
ERROR: Failure: ImportError (Matplotlib backend_wx and backend_wxagg require wxPython >=2.8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/nose/loader.py", line 403, in loadTestsFromName
    module = resolve_name(addr.module)
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/nose/util.py", line 311, in resolve_name
    module = __import__('.'.join(parts_copy))
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pyart/__init__.py", line 15, in <module>
    from . import graph
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pyart/graph/__init__.py", line 22, in <module>
    from .radardisplay import RadarDisplay
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pyart/graph/radardisplay.py", line 17, in <module>
    import matplotlib.pyplot as plt
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/matplotlib/pyplot.py", line 109, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/matplotlib/backends/backend_wxagg.py", line 10, in <module>
    from . import backend_wx    # already uses wxversion.ensureMinimal('2.8')
  File "/home/raul/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/matplotlib/backends/backend_wx.py", line 76, in <module>
    raise ImportError(missingwx)
ImportError: Matplotlib backend_wx and backend_wxagg require wxPython >=2.8

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)

I have wxPython 2.8.10.1-7 installed :/

jjhelmus commented 9 years ago

Do you have an X server running on this machine and if logging in remotely do you have X forwarded (ssh -XY)? If neither of those are true try using a non-interactive backend for matplotlib for the time being. This is controlled by the ~/.matplotlib/matplotlibrc file on the line:

# the default backend; one of GTK GTKAgg GTKCairo GTK3Agg GTK3Cairo
# CocoaAgg MacOSX Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG
# Template
# You can also deploy your own backend outside of matplotlib by
# referring to the module name (which must be in the PYTHONPATH) as
# 'module://my_backend'
backend      : Agg

Changing the backend to Agg should allow the tests to complete. For interactive work you will want to set this to an interactive backend. There any many choice, usually trying a few and seeing which ones work is best.

rvalenzuelar commented 9 years ago

Thanks @jjhelmus , now it passed the test.

Just for reference, I found the matplotlibrc in:

~/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc