[Csnd] python-2.6 and csnd.py problem
| Date | 2009-05-06 16:41 |
| From | Aaron Johnson |
| Subject | [Csnd] python-2.6 and csnd.py problem |
| Can anyone tell me what's going on? Is this because csnd.py is only designed to really work well with Python-2.5? Here's the error message I get trying to load the Python module: ~ $ python Python 2.6.1 (r261:67515, Dec 7 2008, 08:27:41) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import csnd Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/site-packages/csnd.py", line 25, in <module> _csnd = swig_import_helper() File "/usr/lib/python2.6/site-packages/csnd.py", line 24, in swig_import_helper return _mod UnboundLocalError: local variable '_mod' referenced before assignment >>> Any help with this would be greatly appreciated! Best, -- Aaron Krister Johnson http://www.akjmusic.com http://www.untwelve.org |
| Date | 2009-05-06 19:32 |
| From | victor |
| Subject | [Csnd] Re: python-2.6 and csnd.py problem |
|
I guess you'll need to check if SWIG works/supports
2.6. It's often behind
(it took a couple of versions for it to catch up
with 2.5). It is a funny error,
though.
Victor
|
| Date | 2009-05-06 19:35 |
| From | victor |
| Subject | [Csnd] Re: Re: python-2.6 and csnd.py problem |
|
Apparently version1.3.39 works with 2.6, so you
might want to try
updating it, if you have not done it
before.
|
| Date | 2009-05-06 21:33 |
| From | Aaron Krister Johnson |
| Subject | [Csnd] Re: Re: python-2.6 and csnd.py problem |
Victor, I have Swig 1.3.39, so it appears my problem lies elsewhere. I'm going to try some hacking tonight. I don't have an immediate need for the csnd.py lib, but it would be nice. Maybe if I need it anytime soon, I'll just install Python-2.5 alongside 2.6 and see if that somehow works. Thanks, Aaron. Victor.Lazzarini wrote: > > Apparently version1.3.39 works with 2.6, so you might want to try > updating it, if you have not done it before. > ----- Original Message ----- > From: victor > To: csound@lists.bath.ac.uk > Sent: Wednesday, May 06, 2009 7:32 PM > Subject: [Csnd] Re: python-2.6 and csnd.py problem > > > I guess you'll need to check if SWIG works/supports 2.6. It's often > behind > (it took a couple of versions for it to catch up with 2.5). It is a > funny error, > though. > > Victor > ----- Original Message ----- > From: Aaron Johnson > To: csound@lists.bath.ac.uk > Sent: Wednesday, May 06, 2009 4:41 PM > Subject: [Csnd] python-2.6 and csnd.py problem > > > Can anyone tell me what's going on? Is this because csnd.py is only > designed to really work well with Python-2.5? > > Here's the error message I get trying to load the Python module: > > ~ $ python > Python 2.6.1 (r261:67515, Dec 7 2008, 08:27:41) > [GCC 4.3.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import csnd > Traceback (most recent call last): > File " |
| Date | 2009-05-06 21:57 |
| From | victor |
| Subject | [Csnd] Re: Re: Re: python-2.6 and csnd.py problem |
Well, keep us informed. We'll need to go 2.6 sometime in the future, so it is good to know the pitfalls. Victor ----- Original Message ----- From: "Aaron Krister Johnson" |
| Date | 2009-05-06 22:24 |
| From | victor |
| Subject | [Csnd] Re: Re: Re: python-2.6 and csnd.py problem |
In my csnd.py I see this:
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
try:
fp, pathname, description = imp.find_module('_csnd',
[dirname(__file__)])
_mod = imp.load_module('_csnd', fp, pathname, description)
finally:
if fp is not None: fp.close()
return _mod
_csnd = swig_import_helper()
del swig_import_helper
This code is for >=2.6, to load _csnd.so. Perhaps it's not finding this file
and that
is what it is reporting? I reckon this might be the problem. As it can't
find the file,
it raises an exception and _mod is not set?
Victor
----- Original Message -----
From: "Aaron Krister Johnson" |