[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] _gnuradio_swig_python import error on Mac OS X
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] _gnuradio_swig_python import error on Mac OS X |
Date: |
Fri, 15 Apr 2005 17:26:56 -0700 |
User-agent: |
Mutt/1.5.6i |
On Fri, Apr 15, 2005 at 04:58:17PM -0700, Jonathan Jacky wrote:
>
> I build gnuradio-core from the 2.5 tarball on Mac OS X.
>
> After make and make install completed without error messages,
> I tried make check in my gnuradio-core-2.5. (I learned here in January
> that on OS X, make install must precede make check).
Lacking access to hardware, I was unable to test the most recent
tarballs on OS/X. Which version of OS/X are you using?
> Every one of the qa_*.py checks fails with this same traceback:
>
> Traceback (most recent call last):
> File "./qa_add_and_friends.py", line 23, in ?
> from gnuradio import gr, gr_unittest
> File
> "/Users/jon/gnuradio/gnuradio-core-2.5/src/python/gnuradio/gr/__init__.py\
> ", line 27, in ?
> from gnuradio_swig_python import *
> File
> "/Users/jon/gnuradio/gnuradio-core-2.5/src/lib/swig/gnuradio_swig_python.\
> py", line 5, in ?
> import _gnuradio_swig_python
> ImportError: No module named _gnuradio_swig_python
>
> I find I have these files under my gnuradio-core-2.5:
>
> gnuradio-core-2.5/src/lib/swig/_gnuradio_swig_python.la
> gnuradio-core-2.5/src/lib/swig/.libs/_gnuradio_swig_python.la
> gnuradio-core-2.5/src/lib/swig/.libs/_gnuradio_swig_python.lai
> gnuradio-core-2.5/src/lib/swig/.libs/_gnuradio_swig_python.dylib
>
> I find that make install also installed these:
>
> /Library/Python/2.3/gnuradio/gr/_gnuradio_swig_python.la
> /Library/Python/2.3/gnuradio/gr/_gnuradio_swig_python.dylib
>
> However, I don't find a _gnuradio_swig_python.py, .pyc, or .pyo
> anywhere
That's normal.
_gnuradio_swig_python.dylib is the SWIG generated shared library.
gnuradio_swig_python.py (no leading _) is the SWIG generated Python
wrapper that loads and calls into the shared library.
When you
from gnuradio import gr
these are imported for you. You can see how this works by looking at
{prefix}/lib/python{pyversion}/site-packages/gnuradio/gr/__init__.py
> I thought it might be a problem with the Python path, but python can
> import other .py files from under /Library/Python/2.3 without an
> explicit path being given. In a python terminal session, "print
> sys.path" shows the path includes
> '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/
> site-packages', which is a link to /Library/Python/2.3.
>
> Any suggestions? Am I supposed to have a
> _gnuradio_swig_python.py,.pyc, or .pyo somewhere? Is python supposed
> to import _gnuradio_swig_python.la,.lai, or .dylib?
>
> Jon Jacky
The reason for the comments re "make install" before "make check" was
to work around some differences in how libtool worked on OS/X. During
make check we try to use non-installed libraries that depended on
other non-installed libraries. Last time I checked, this didn't
work on OS/X. It's admittedly a bit of a corner case.
I can probably locate a Mac over the weekend. Let me see what I come
up with.
Eric