My suggestion is to pick one way and do everything that way. Either of
these will work, but "mix and match" often causes troubles albeit is not
totally impossible. I've tried all and each has its own advantages and
disadvantages, which I will not summarize here:
a) compile from source
b) install binaries from apt-get
c) install from source via pip
d) use conda
I think you encountered one of the gazillion of the possible "mix and
match" errors. Since you seem to prefer a), I suggest you compile
netcdf4pythong with a) instead of c) -- but as others have suggested, there
are the other options too, and d) seems to be the most popular these days...
Cheers,
Davide
Regards,
Davide Del Vento,
NCAR Computational & Information Services Laboratory
Consulting Services Software Engineer
http://www2.cisl.ucar.edu/uss/csg/
SEA Chair http://sea.ucar.edu/
office: Mesa Lab, Room 55G
phone: (303) 497-1233
On Thu, Jun 16, 2016 at 4:59 AM, Ryan May <rmay@xxxxxxxx> wrote:
> Ashwin,
>
> That sounds entirely too painful. Given that, I'd say miniconda (using the
> conda-forge channel as necessary for additional packages) is probably your
> best bet. Personally, I'd much rather be focused on using Python rather
> than figuring out a compiler.
>
> Ryan
>
> On Wed, Jun 15, 2016 at 8:47 PM, ashwinD12 <winash12@xxxxxxxxx> wrote:
>
>> Ryan,
>> I do have the hd5 installed yes. It is under /usr/local/lib
>> and /usr/local/include. When I installed WRF two years ago these are
>> required libraries. What I saw in this URL is
>>
>>
>> http://bryanwweber.com/writing/personal/2014/01/11/installing-numpy-scipy-on-ubuntu-12.04.3-from-scratch-source-with-intel-compilers/
>>
>> I need to make changes to the intelcompiler.py file so that it reflects
>> my environment. How I do not know yet.
>>
>>
>>
>> Regards,
>> Ashwin.
>>
>> On Wed, Jun 15, 2016 at 8:45 PM, Ryan May <rmay@xxxxxxxx> wrote:
>>
>>> Ashwin,
>>>
>>> I echo that conda is a good solution in general, but I want to clarify
>>> something. Your original problem was missing the C HDF5 library--your
>>> installing h5py does nothing to solve this. Instead, you should install the
>>> hdf5 libs on Ubuntu (not using pip, but apt-get).
>>>
>>> Ryan
>>>
>>> On Tue, Jun 14, 2016 at 11:21 PM, ashwinD12 <winash12@xxxxxxxxx> wrote:
>>>
>>>> Hello,
>>>> I am trying to install netcdf4 package on Ubuntu 14.04
>>>> using the following command
>>>>
>>>> pip3 install netcdf4. This did install successfully but when I try to
>>>> execute a script which had import netCDF4 I get the following error -
>>>>
>>>>
>>>> My python is compiled with icc and not gcc !
>>>>
>>>> Traceback (most recent call last):
>>>> File "display.py", line 5, in <module>
>>>> from netCDF4 import Dataset # http://code.google.com/p/netcdf4-python/
>>>> File "/usr/local/lib/python3.4/dist-packages/netCDF4/__init__.py", line 3,
>>>> in <module> from ._netCDF4 import *
>>>> File "netCDF4/_netCDF4.pyx", line 942, in init netCDF4._netCDF4
>>>> (netCDF4/_netCDF4.c:76006)
>>>> File "/usr/local/lib/python3.4/dist-packages/netcdftime/__init__.py", line
>>>> 1, in <module>
>>>> from .netcdftime import utime, JulianDayFromDate, DateFromJulianDay
>>>> File "/usr/local/lib/python3.4/dist-packages/netcdftime/netcdftime.py",
>>>> line 14, in <module>
>>>> from ._datetime import datetime
>>>> ImportError:
>>>> /usr/local/lib/python3.4/dist-packages/netcdftime/_datetime.cpython-34m.so:
>>>> undefined symbol: __intel_sse2_strchr
>>>>
>>>>
>>>> So it looks like this has a dependency on cython and hdf5.
>>>>
>>>> So I did install cython and that did install successfully.
>>>>
>>>> When I do a pip3 install h5py I get the following errors -
>>>>
>>>> Traceback (most recent call last):
>>>>
>>>> File "<string>", line 1, in <module>
>>>>
>>>> File "/tmp/pip_build_root/h5py/setup.py", line 149, in <module>
>>>>
>>>> cmdclass = CMDCLASS,
>>>>
>>>> File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
>>>>
>>>> dist.run_commands()
>>>>
>>>> File "/usr/lib/python3.4/distutils/dist.py", line 955, in
>>>> run_commands
>>>>
>>>> self.run_command(cmd)
>>>>
>>>> File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
>>>>
>>>> cmd_obj.run()
>>>>
>>>> File "/usr/lib/python3/dist-packages/setuptools/command/install.py",
>>>> line 53, in run
>>>>
>>>> return _install.run(self)
>>>>
>>>> File "/usr/lib/python3.4/distutils/command/install.py", line 583, in
>>>> run
>>>>
>>>> self.run_command('build')
>>>>
>>>> File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
>>>>
>>>> self.distribution.run_command(command)
>>>>
>>>> File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
>>>>
>>>> cmd_obj.run()
>>>>
>>>> File "/usr/lib/python3.4/distutils/command/build.py", line 126, in
>>>> run
>>>>
>>>> self.run_command(cmd_name)
>>>>
>>>> File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
>>>>
>>>> self.distribution.run_command(command)
>>>>
>>>> File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
>>>>
>>>> cmd_obj.run()
>>>>
>>>> File "/tmp/pip_build_root/h5py/setup_build.py", line 147, in run
>>>>
>>>> from Cython.Build import cythonize
>>>>
>>>> File "/usr/local/lib/python3.4/dist-packages/Cython/Build/__init__.py",
>>>> line 1, in <module>
>>>>
>>>> from .Dependencies import cythonize
>>>>
>>>> File
>>>> "/usr/local/lib/python3.4/dist-packages/Cython/Build/Dependencies.py",
>>>> line 50, in <module>
>>>>
>>>> from ..Compiler.Main import Context, CompilationOptions,
>>>> default_options
>>>>
>>>> File "/usr/local/lib/python3.4/dist-packages/Cython/Compiler/Main.py",
>>>> line 28, in <module>
>>>>
>>>> from .Scanning import PyrexScanner, FileSourceDescriptor
>>>>
>>>> ImportError: /usr/local/lib/python3.4/dist-packages/Cython/Compiler/
>>>> Scanning.cpython-34m.so <http://scanning.cpython-34m.so/>: undefined
>>>> symbol: __intel_sse2_strchr
>>>>
>>>
>>>
>>>
>>> --
>>> Ryan May, Ph.D.
>>> Software Engineer
>>> UCAR/Unidata
>>> Boulder, CO
>>>
>>
>>
>
>
> --
> Ryan May, Ph.D.
> Software Engineer
> UCAR/Unidata
> Boulder, CO
>
> _______________________________________________
> NOTE: All exchanges posted to Unidata maintained email lists are
> recorded in the Unidata inquiry tracking system and made publicly
> available through the web. Users who post to any of the lists we
> maintain are reminded to remove any personal information that they
> do not want to be made public.
>
>
> python-users mailing list
> python-users@xxxxxxxxxxxxxxxxxxxxxxxx
> For list information, to unsubscribe, or change your membership options,
> visit: http://www.unidata.ucar.edu/mailing_lists/
>