running .py files on Linux

Chris Rebert crebert at ucsd.edu
Tue Apr 27 17:34:17 CEST 2010


> 2010/4/27 Chris Rebert <crebert at ucsd.edu>
>> > 2010/4/27 Chris Rebert <clp2 at rebertia.com>
>> >> On Tue, Apr 27, 2010 at 3:54 AM, Tingting HAN <hihighsky at gmail.com>
>> >> wrote:
>> >> <snip>
>> >> >> gentest_empty.py
>> >> >> Traceback (most recent call last):
>> >> >>   File "gentest_empty.py", line 8, in <module>
>> >> >>     from tables import *
>> >> >>   File "/usr/lib/python2.6/dist-packages/tables/__init__.py", line
>> >> >> 76,
>> >> >> in
>> >> >> <module>
>> >> >>     from tables.file import File, openFile, copyFile
>> >> >>   File "/usr/lib/python2.6/dist-packages/tables/file.py", line 44,
>> >> >> in
>> >> >> <module>
>> >> >>     from tables import hdf5Extension
>> >> >>   File "hdf5Extension.pyx", line 11, in hdf5Extension
>> >> >> ImportError: No module named utilsExtension
>> >> >
>> >> >
>> >> >>
>> >> >> I attach two .py files from the downloaded package in this email.
>> >> >> Could
>> >> >> you please try running them and see what is the problem?
>> >>
>> >> Seems like your version of PyTables may be outdated. Your error looks
>> >> similar to that described in this (fixed) bug:
>> >> http://www.pytables.org/trac/ticket/183
>> >>
>> >> What version of PyTables do you have installed?
>> On Tue, Apr 27, 2010 at 5:06 AM, Tingting HAN <hihighsky at gmail.com> wrote:
>> > I apologize that I am new to Linux. I find this in my computer:
>> > /usr/lib/python2.6/dist-packages/tables$
>> > How should I know which version of PyTables has been installed? What is
>> > the
>> > command?
>>
>> Well, there are more generic ways depending on how you installed it,
>> but for this particular package:
>> python -c 'from tables.table import obversion; print obversion'
>>
>> > Which version should I download to solve the problem?
>>
>> Dunno exactly, but based on the dates, it was fixed before 2.1.2
>>
>> > And could you please
>> > give me the website link to download it because I am afraid I can not
>> > find
>> > the right place exactly.
>>
>> Might as well just go for the latest version:
>>
>> http://www.pytables.org/download/preliminary/pytables-2.2b3/tables-2.2b3.tar.gz

On Tue, Apr 27, 2010 at 8:12 AM, Tingting HAN <hihighsky at gmail.com> wrote:
> Well, another person in our lab solved it by using the command:
> python2.5 configuration.py
> I do not know exactly why python2.6 in my computer does not work. The code
> packet I dowloaded was was made in 2007, so maybe old versions of python
> should work.

That's unsurprising. As stated in the bug, the problem is related to a
language change that happened in Python 2.6; obviously using an older
version of Python would "fix" that, although you're stuck without the
other niceties of v2.6 over v2.5, and without whatever bug fixes have
been applied to PyTables since the version you're using.

At any rate, glad you got it working.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list