compileall binaries don't run!?

D

Daniel

Hi,

I'm trying to use compileall to make pyc files from py files (without
having to execute them at the same time).

This is the first time I've used compileall, so maybe I've done
something silly.

I run it like this:

python /usr/lib/python2.2/compileall.py /home/me/mySourceDir

And the output looks fine, resulting in a bunch of pyc files.

Then I try running the pyc file eg.:

/home/me/mySourceDir/doodad.pyc

But get the following error:
bash: ./doodad.pyc: cannot execute binary file

I notice that when I execute doodad.py, no pyc file is generated. Does
this mean that Python can only make pyc files from some BUT NOT ALL py
files? Is this my problem?

I've ensured file access permissions are correct.

Thanks,
Dan.
 
C

Cousin Stanley

| ...
| And the output looks fine, resulting in a bunch of pyc files.
|
| Then I try running the pyc file eg.:
|
| /home/me/mySourceDir/doodad.pyc
|
| But get the following error:
| bash: ./doodad.pyc: cannot execute binary file

Daniel ....

As the .pyc files are not stand-alone executables,
you might try passing the path of the compiled file
to the Python interpreter ....

python /home/me/mySourceDir/doodad.pyc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top