compileall binaries don't run!?

Discussion in 'Python' started by Daniel, Jan 7, 2004.

  1. Daniel

    Daniel Guest

    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.
     
    Daniel, Jan 7, 2004
    #1
    1. Advertising

  2. | ...
    | 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

    --
    Cousin Stanley
    Human Being
    Phoenix, Arizona
     
    Cousin Stanley, Jan 7, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marco Herrn
    Replies:
    1
    Views:
    425
    Erwin S. Andreasen
    Jan 13, 2004
  2. Swaroop C H

    Pipes of binaries - IPC::Run

    Swaroop C H, May 11, 2005, in forum: Python
    Replies:
    1
    Views:
    363
    Peter Hansen
    May 11, 2005
  3. robert
    Replies:
    4
    Views:
    272
    Robin Becker
    Dec 15, 2006
  4. KevinSimonson
    Replies:
    17
    Views:
    683
    KevinSimonson
    Sep 28, 2009
  5. Pony
    Replies:
    1
    Views:
    573
    Chris Rebert
    Jun 8, 2011
Loading...

Share This Page