AttributeError: 'module' object has no attribute 'SEEK_CUR' on CentOS release 5.8 (Final) #5

Closed
cyberscribe opened this Issue May 9, 2012 · 9 comments

Comments

Projects
None yet
2 participants

Tried installing via easy_install and also git clone. Help screen runs, but when trying to run with an input file it gives:

Traceback (most recent call last):
File "/usr/bin/qtfaststart", line 77, in ?
processor.process(args[0], outfile, limit = limit)
File "build/bdist.linux-i686/egg/qtfaststart/processor.py", line 121, in process
File "build/bdist.linux-i686/egg/qtfaststart/processor.py", line 65, in get_index
AttributeError: 'module' object has no attribute 'SEEK_CUR'

Am running:

Linux dev 2.6.18-308.1.1.el5PAE #1 SMP Wed Mar 7 04:57:46 EST 2012 i686 i686 i386 GNU/Linux

Owner

danielgtaylor commented May 9, 2012

Are you sure you are using the latest code? This fix should have solved that issue a while ago:

6f29c10

Yep, afraid so. I saw the os.SEEK_CUR fix, but this would seem to be a
module.SEEK_CUR issue... if that's possible?

On Wed, May 9, 2012 at 5:39 PM, Daniel G. Taylor <
reply@reply.github.com

wrote:

Are you sure you are using the latest code? This fix should have solved
that issue a while ago:

6f29c10


Reply to this email directly or view it on GitHub:
#5 (comment)

Owner

danielgtaylor commented May 9, 2012

I just tested on RHEL5, which does not have SEEK_CUR defined and it works fine. I think that CentOS 5 and RHEL5 are about the same. I'm not sure what the issue could be, and line 65 in the latest code is a comment, not an executable line, which leads me to believe you do not have the latest code or that the code has been somehow modified. Try the following in a terminal:

cd
git clone git://github.com/danielgtaylor/qtfaststart.git
cd qtfaststart
wget http://mirror.cessen.com/blender.org/peach/trailer/trailer_iphone.m4v
bin/qtfaststart  trailer_iphone.m4v trailer_iphone-out.mp4

If you don't have access to git on the box, you can wget https://github.com/danielgtaylor/qtfaststart/zipball/master and unzip the result. The unzipped directory will be named something like qtfaststart-abc123.

Hi Daniel,

Thanks for your help. I followed your steps exactly and still get:

Traceback (most recent call last):
File "bin/qtfaststart", line 77, in ?
processor.process(args[0], outfile, limit = limit)
File "build/bdist.linux-i686/egg/qtfaststart/processor.py", line 121, in
process
File "build/bdist.linux-i686/egg/qtfaststart/processor.py", line 65, in
get_index
AttributeError: 'module' object has no attribute 'SEEK_CUR'

I am doing all this as root on the machine. It is running
python-2.4.3-46.el5. Here's they python -v output:

installing zipimport hook

import zipimport # builtin

installed zipimport hook

/usr/lib/python2.4/site.pyc matches /usr/lib/python2.4/site.py

import site # precompiled from /usr/lib/python2.4/site.pyc

/usr/lib/python2.4/os.pyc matches /usr/lib/python2.4/os.py

import os # precompiled from /usr/lib/python2.4/os.pyc
import posix # builtin

/usr/lib/python2.4/posixpath.pyc matches /usr/lib/python2.4/posixpath.py

import posixpath # precompiled from /usr/lib/python2.4/posixpath.pyc

/usr/lib/python2.4/stat.pyc matches /usr/lib/python2.4/stat.py

import stat # precompiled from /usr/lib/python2.4/stat.pyc
import errno # builtin

/usr/lib/python2.4/UserDict.pyc matches /usr/lib/python2.4/UserDict.py

import UserDict # precompiled from /usr/lib/python2.4/UserDict.pyc

/usr/lib/python2.4/copy_reg.pyc matches /usr/lib/python2.4/copy_reg.py

import copy_reg # precompiled from /usr/lib/python2.4/copy_reg.pyc

/usr/lib/python2.4/types.pyc matches /usr/lib/python2.4/types.py

import types # precompiled from /usr/lib/python2.4/types.pyc

zipimport: found 12 names in

/usr/lib/python2.4/site-packages/qtfaststart-1.5-py2.4.egg
import japanese # directory /usr/lib/python2.4/site-packages/japanese

/usr/lib/python2.4/site-packages/japanese/init.pyc matches

/usr/lib/python2.4/site-packages/japanese/init.py
import japanese # precompiled from
/usr/lib/python2.4/site-packages/japanese/init.pyc
import japanese.aliases # directory
/usr/lib/python2.4/site-packages/japanese/aliases

/usr/lib/python2.4/site-packages/japanese/aliases/init.pyc matches

/usr/lib/python2.4/site-packages/japanese/aliases/init.py
import japanese.aliases # precompiled from
/usr/lib/python2.4/site-packages/japanese/aliases/init.pyc
import encodings # directory /usr/lib/python2.4/encodings

/usr/lib/python2.4/encodings/init.pyc matches

/usr/lib/python2.4/encodings/init.py
import encodings # precompiled from
/usr/lib/python2.4/encodings/init.pyc

/usr/lib/python2.4/codecs.pyc matches /usr/lib/python2.4/codecs.py

import codecs # precompiled from /usr/lib/python2.4/codecs.pyc
import _codecs # builtin

/usr/lib/python2.4/encodings/aliases.pyc matches

/usr/lib/python2.4/encodings/aliases.py
import encodings.aliases # precompiled from
/usr/lib/python2.4/encodings/aliases.pyc

/usr/lib/python2.4/warnings.pyc matches /usr/lib/python2.4/warnings.py

import warnings # precompiled from /usr/lib/python2.4/warnings.pyc

/usr/lib/python2.4/linecache.pyc matches /usr/lib/python2.4/linecache.py

import linecache # precompiled from /usr/lib/python2.4/linecache.pyc

/usr/lib/python2.4/encodings/utf_8.pyc matches

/usr/lib/python2.4/encodings/utf_8.py
import encodings.utf_8 # precompiled from
/usr/lib/python2.4/encodings/utf_8.pyc
Python 2.4.3 (#1, Feb 22 2012, 16:06:13)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib/python2.4/lib-dynload/readline.so", 2);
import readline # dynamically loaded from
/usr/lib/python2.4/lib-dynload/readline.so

I believe this CentOS is fairly "vanilla" in terms of python eggs etc.
but now I'm doubting that based on the results of your own tests.

Best,
Robert

On Wed, May 9, 2012 at 6:02 PM, Daniel G. Taylor <
reply@reply.github.com

wrote:

I just tested on RHEL5, which does not have SEEK_CUR defined and it works
fine. I think that CentOS 5 and RHEL5 are about the same. I'm not sure what
the issue could be, and line 65 in the latest code is a comment, not an
executable line, which leads me to believe you do not have the latest code
or that the code has been somehow modified. Try the following in a terminal:

cd
git clone git://github.com/danielgtaylor/qtfaststart.git
cd qtfaststart
wget
http://mirror.cessen.com/blender.org/peach/trailer/trailer_iphone.m4v
bin/qtfaststart trailer_iphone.m4v trailer_iphone-out.mp4

If you don't have access to git on the box, you can wget
https://github.com/danielgtaylor/qtfaststart/zipball/master and unzip the
result. The unzipped directory will be named something like
qtfaststart-abc123.


Reply to this email directly or view it on GitHub:
#5 (comment)

Owner

danielgtaylor commented May 9, 2012

That's quite strange - it seems to still be importing from the egg instead of from the new git clone you did. Take a look at:

python -c "import sys; print sys.path"

It should show a blank string or single period as the first entry, telling Python to import from the local directory before system directories, e.g. mine starts with ['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4', ...]. Alternatively you can uninstall the egg or install the latest code (possibly overwriting the older code) with:

sudo python setup.py install

In the top qtfaststart directory. Let me know if any of that helps!

Strange indeed. My sys.path does indeed show a blank string as the first
entry:

['', '/usr/lib/python2.4/site-packages/qtfaststart-1.5-py2.4.egg',
'/usr/lib/python24.zip', '/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages',
'/usr/lib/python2.4/site-packages/Numeric',
'/usr/lib/python2.4/site-packages/gtk-2.0']

and when I do python setup.py install, I see:

copying build/scripts-2.4/qtfaststart -> /usr/bin
changing mode of /usr/bin/qtfaststart to 755

and which qtfaststart says /usr/bin/qtfaststart, which has a modification
time indiciating it's the one from the build.

But still when I run qtfaststart trailer_iphone.m4v I still get:

Traceback (most recent call last):
File "/usr/bin/qtfaststart", line 77, in ?
processor.process(args[0], outfile, limit = limit)
File "build/bdist.linux-i686/egg/qtfaststart/processor.py", line 121, in
process
File "build/bdist.linux-i686/egg/qtfaststart/processor.py", line 65, in
get_index
AttributeError: 'module' object has no attribute 'SEEK_CUR'

FWIW, on line 18 of
/usr/lib/python2.4/site-packages/qtfaststart/processor.py I see:

Older versions of Python require this to be defined

if not hasattr(os, 'SEEK_CUR'):
os.SEEK_CUR = 1

...which I believe is the SEEK_CUR patch?

On Wed, May 9, 2012 at 6:56 PM, Daniel G. Taylor <
reply@reply.github.com

wrote:

That's quite strange - it seems to still be importing from the egg instead
of from the new git clone you did. Take a look at:

python -c "import sys; print sys.path"

It should show a blank string or single period as the first entry, telling
Python to import from the local directory before system directories, e.g.
mine starts with ['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4',
...]. Alternatively you can uninstall the egg or install the latest code
(possibly overwriting the older code) with:

sudo python setup.py install

In the top qtfaststart directory. Let me know if any of that helps!


Reply to this email directly or view it on GitHub:
#5 (comment)

Owner

danielgtaylor commented May 9, 2012

Very weird. It looks like you have the latest copy in /usr/lib/python2.4/site-packages/qtfaststart/processor.py, but the stack trace from the crash is showing it was loading from build/bdist.linux-i686/egg/qtfaststart/processor.py instead. Can you remove '/usr/lib/python2.4/site-packages/qtfaststart-1.5-py2.4.egg' as it is the older version that is being picked up and messing everything up?

Dan,

Thanks! That did the trick.

A bad egg spoiling everything. How poetic.

Cheers,
Robert

On Wed, May 9, 2012 at 8:15 PM, Daniel G. Taylor <
reply@reply.github.com

wrote:

Very weird. It looks like you have the latest copy in
/usr/lib/python2.4/site-packages/qtfaststart/processor.py, but the stack
trace from the crash is showing it was loading from
build/bdist.linux-i686/egg/qtfaststart/processor.py instead. Can you remove
'/usr/lib/python2.4/site-packages/qtfaststart-1.5-py2.4.egg' as it is the
older version that is being picked up and messing everything up?


Reply to this email directly or view it on GitHub:
#5 (comment)

Owner

danielgtaylor commented May 16, 2012

Glad to hear you got it working :-)

On Wed, May 16, 2012 at 12:08 PM, Robert Peake
reply@reply.github.com
wrote:

Dan,

Thanks! That did the trick.

A bad egg spoiling everything. How poetic.

Cheers,
Robert

On Wed, May 9, 2012 at 8:15 PM, Daniel G. Taylor <
reply@reply.github.com

wrote:

Very weird. It looks like you have the latest copy in
/usr/lib/python2.4/site-packages/qtfaststart/processor.py, but the stack
trace from the crash is showing it was loading from
build/bdist.linux-i686/egg/qtfaststart/processor.py instead. Can you remove
'/usr/lib/python2.4/site-packages/qtfaststart-1.5-py2.4.egg' as it is the
older version that is being picked up and messing everything up?


Reply to this email directly or view it on GitHub:
#5 (comment)


Reply to this email directly or view it on GitHub:
#5 (comment)

Daniel G. Taylor
http://programmer-art.org/

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