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

problems with snow leopard install #24

Closed
dopplershift opened this issue Feb 26, 2014 · 15 comments
Closed

problems with snow leopard install #24

dopplershift opened this issue Feb 26, 2014 · 15 comments

Comments

@dopplershift
Copy link
Member

From ohtinsel@gmail.com on September 14, 2009 15:24:39

What steps will reproduce the problem? 1. Installed netcdf 4.0.1 both from source and using macports (same issue).
2. downloaded netCDF4-0.8.2
3. basic install What is the expected output? What do you see instead? some install warnings.

mbauer@boreas:~/Downloads/netCDF4-0.8.2/ > sudo python setup.py install
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Pyrex/Compiler/Errors.py:17:
DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
self.message = message

HDF5_DIR environment variable not set, checking some standard locations ..,
checking /Users/mbauer ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
HDF5 found in /opt/local

NETCDF4_DIR environment variable not set, checking some standard locations ..,
checking /Users/mbauer ...
checking /usr/local ...
netCDF4 found in /usr/local
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py:267:
UserWarning: Unknown distribution option: 'summary'
warnings.warn(msg)
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
building py_modules sources
building extension "netCDF4" sources
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
running scons
running build_scripts
running install_lib
running install_scripts
changing mode of
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/grib2nc4 to 755
changing mode of
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/nc3tonc4 to 755
changing mode of
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/nc4tonc3 to 755
running install_egg_info
Removing
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4-0.8.2-py2.6.egg-info
Writing
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4-0.8.2-py2.6.egg-info What version of the product are you using? On what operating system? python 2.6.2 (via macports)
netcdf 4.0.1 (tried both macports and direct install)
hdf5 1.8.3 (via macports) Please provide any additional information below. Attend to call netcdf4 in python give the following:

import netCDF4
ImportError:
dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4.so,
2): Symbol not found: _nc_close
Referenced from:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4.so
Expected in: flat namespace
in
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4.so

I get the same for netcdf3 only as well.

Mike

Original issue: http://code.google.com/p/netcdf4-python/issues/detail?id=24

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on September 14, 2009 16:40:09

Looks like your netcdf library in /usr/local was detected - and this is not the macports version. Did you build
netcdf-4 yourself and install in /usr/local? Try setting the NETCDF4_DIR env var to /opt/local before running
setup.py. The fact that the nc_close symbol is not found means there is a problem with the netcdf lib you are
linking to.

Also, be sure to blow away your build directory before re-running setup.py.

-Jeff

@dopplershift
Copy link
Member Author

From ohtinsel@gmail.com on September 16, 2009 07:16:38

Indeed, I fore reinstalled netcdf+netcdf4 via macports and then blew away netcdf from
/usr/local and then the local build. All went wellish (see below) with some warnings
but it works.

Thank you,

Mike

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Pyrex/Compiler/Errors.py:17:
DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
self.message = message

HDF5_DIR environment variable not set, checking some standard locations ..,
checking /Users/mbauer ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
HDF5 found in /opt/local

NETCDF4_DIR environment variable not set, checking some standard locations ..,
checking /Users/mbauer ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
netCDF4 found in /opt/local
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py:267:
UserWarning: Unknown distribution option: 'summary'
warnings.warn(msg)
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
building py_modules sources
building extension "netCDF4" sources
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
running scons
running build_scripts
running install_lib
copying build/lib.macosx-10.6-i386-2.6/netCDF4.so ->
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
running install_scripts
copying build/scripts.macosx-10.6-i386-2.6/grib2nc4 ->
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
copying build/scripts.macosx-10.6-i386-2.6/nc3tonc4 ->
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
copying build/scripts.macosx-10.6-i386-2.6/nc4tonc3 ->
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
changing mode of
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/grib2nc4 to 755
changing mode of
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/nc3tonc4 to 755
changing mode of
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/nc4tonc3 to 755
running install_egg_info
Removing
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4-0.8.2-py2.6.egg-info
Writing
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4-0.8.2-py2.6.egg-info

@dopplershift
Copy link
Member Author

From Rob.Cer...@gmail.com on April 20, 2010 15:48:13

Hi Jeff,

Have a different problem. Got past HDF5 and NetCDF... though I violated by own
install rules and need to backtrack. Here is my info:

RODAN:gdal-1.7.1 cermak$ uname -a
Darwin RODAN.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010;
root:xnu-1504.3.121/RELEASE_I386 i386
RODAN:gdal-1.7.1 cermak$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646.1
2/src/configure --disable-checking
--enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib
--build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
--program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10
--target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)

Cleanly compiles, but loading the module results in a missing symbol.

import netCDF4
Traceback (most recent call last):
File "", line 1, in
ImportError: dlopen(/Users/cermak/local/lib/python2.6/site-packages/netCDF4.so, 2):
Symbol not found: _curl_easy_cleanup
Referenced from: /Users/cermak/local/lib/python2.6/site-packages/netCDF4.so
Expected in: flat namespace
in /Users/cermak/local/lib/python2.6/site-packages/netCDF4.so

@dopplershift
Copy link
Member Author

From Rob.Cer...@gmail.com on April 21, 2010 01:41:52

Solved it. If the netcdf4 library is compiled with libdap then we also need to
include libcurl during the python module compile. Until auto-detected, need to add
curl to this line in setup.py:

libs = ['netcdf','hdf5_hl','hdf5','z','curl']

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on April 21, 2010 02:52:02

Rob: You shouldn't need to do this if netcdf and curl are both compiled as shared libs.

-Jeff

@dopplershift
Copy link
Member Author

From ohtinsel@gmail.com on April 21, 2010 06:38:29

Rob,

I had similar problems, which lead me to downgrade to netcdf3. Anyway, I tried your
solution and it did resolve the "_curl_easy_cleanup" problem but not I get this...

Traceback (most recent call last):
File "run_all.py", line 1, in
import glob, os, sys, unittest, netCDF4
ImportError:
dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4.so,
2): Symbol not found: _nc_def_compound
Referenced from:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4.so
Expected in: flat namespace
in
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/netCDF4.so

I'm using the newest macports and the newest ports including netcdf-devel.

Mike

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on April 21, 2010 06:46:10

: Symbol not found: _nc_def_compound

this indicates the netcdf lib was compiled without netcdf-4 support (enable with the --enable-netcdf-4
configure switch)

@dopplershift
Copy link
Member Author

From ohtinsel@gmail.com on April 21, 2010 07:04:08

Ah, macports installed netcdf (w/o netcdf4 support) and netcdf-devel (w/ netcdf4
support). Apparently, one has to be careful about the order of install with macports
due to dependences. Thanks for the tip.

Mike

@dopplershift
Copy link
Member Author

From barbi.br...@gmail.com on April 28, 2010 02:21:36

I am using netcdf4 along with pycdf 0.6. When I run my program, I get this error. Any
idea on how to solve this?

$ python synbioss.py
Traceback (most recent call last):
File "synbioss.py", line 111, in
import synbiossgtk
File "/.....synbioss-1.0.2/synbiossgtk.py", line 14, in
import hy3s
File "/.....synbioss-1.0.2/hy3s.py", line 2, in
import pycdf as cdf
File "/Library/Python/2.5/site-packages/pycdf/init.py", line 22, in
from pycdf import *
File "/Library/Python/2.5/site-packages/pycdf/pycdf.py", line 1096, in
import pycdfext as _C
File "/Library/Python/2.5/site-packages/pycdf/pycdfext.py", line 5, in
import _pycdfext
ImportError: dlopen(/Library/Python/2.5/site-packages/pycdf/_pycdfext.so, 2): Symbol
not found: _curl_easy_cleanup
Referenced from: /Library/Python/2.5/site-packages/pycdf/_pycdfext.so
Expected in: dynamic lookup

Thanks,
Bharadwaj

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on April 28, 2010 04:30:10

This is a pycdf import error and is unrelated to netcdf4-python. Libcurl is not being found.

-Jeff

@dopplershift
Copy link
Member Author

From helg...@gmail.com on September 12, 2012 06:26:30

I got the same issue today even with the latest versions:

netcdf-python V1.0

Enthought Python Distribution (EPD) free version -- www.enthought.com
Version: 7.3-2 (32-bit)
Python 2.7.3 |EPD_free 7.3-2 (32-bit)| (default, Apr 12 2012, 11:28:34)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin

All libs for netcdf, HDF in /usr/local/lib V4.2

when calling python and use "import netCDF4" I got the error

ImportError: dlopen(./netCDF4.so, 2): Symbol not found: _nc_close
Referenced from: /Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/netCDF4.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/netCDF4.so

This is not an issue with the netcdf libs! When using the standard Apple 2.7 python package the import works.
(However installing interesting stuff like Chaco graphics does not work on 2.7, thats why I would like to stay with the enthought distribution)

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on September 12, 2012 06:39:25

It's not an issue with netcdf4-python either - it's something in your environment that is preventing the right libraries from being loaded. netcdf4-python comes with EPD, so it should just work (without you having to build and install anything else). You must have something in your environment that is causing the Enthought python to ignore the library that it installed and pick up another one.

@dopplershift
Copy link
Member Author

From helg...@gmail.com on September 12, 2012 06:54:47

I am using the free EPD which unfortunately does not include the netcdf4 module..

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on September 12, 2012 07:31:55

Another option, if you can't get your own build to work, is to use macports (the package is called py-netcdf4).

@dopplershift
Copy link
Member Author

From whitaker.jeffrey@gmail.com on February 25, 2014 18:04:09

Status: Fixed

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

No branches or pull requests

1 participant