Problem with py2exe conversion.

Discussion in 'Python' started by venutaurus539@gmail.com, Mar 4, 2009.

  1. Guest

    Hello all,
    I am facing an interesting problem with py2exe conversion.
    I've a python script which uses the shutil libarary. When I convert
    that python script into exe, it creates a dist folder and then in that
    it places the exe. Along with the exe it also places a zip folder
    containing pre compiled python scripts( library.zip).I have two
    Win2003 machines.On one machine when I genreate the exe that zip file
    also contains this shutil.pyc, but when I build the same python script
    on the second machine, that shutli.pyc is missing in that zip file as
    a result fo which I am unable to use that library on the second
    machine. When I use it, it throws an error:

    ImportError: No module named shutil

    Can some one please suggest me a solution for this.

    Thanks in advance,
    Venu
     
    , Mar 4, 2009
    #1
    1. Advertising

  2. En Wed, 04 Mar 2009 11:12:32 -0200,
    <> escribió:

    > Hello all,
    > I am facing an interesting problem with py2exe conversion.
    > I've a python script which uses the shutil libarary. When I convert
    > that python script into exe, it creates a dist folder and then in that
    > it places the exe. Along with the exe it also places a zip folder
    > containing pre compiled python scripts( library.zip).I have two
    > Win2003 machines.On one machine when I genreate the exe that zip file
    > also contains this shutil.pyc, but when I build the same python script
    > on the second machine, that shutli.pyc is missing in that zip file as
    > a result fo which I am unable to use that library on the second
    > machine. When I use it, it throws an error:
    >
    > ImportError: No module named shutil
    >
    > Can some one please suggest me a solution for this.


    Are you sure it's the same script? The same setup.py? The same py2exe
    version? Aren't you sharing the same directory for several projects?

    --
    Gabriel Genellina
     
    Gabriel Genellina, Mar 4, 2009
    #2
    1. Advertising

  3. Guest

    On Mar 4, 6:23 pm, "Gabriel Genellina" <> wrote:
    > En Wed, 04 Mar 2009 11:12:32 -0200,  
    > <> escribió:
    >
    > > Hello all,
    > >             I am facing an interesting problem with py2exe conversion.
    > > I've a python script which uses the shutil libarary. When I convert
    > > that python script into exe, it creates a dist folder and then in that
    > > it places the exe. Along with the exe it also places a zip folder
    > > containing pre compiled python scripts( library.zip).I have two
    > > Win2003 machines.On one machine when I genreate the exe that zip file
    > > also contains this shutil.pyc, but when I build the same python script
    > > on the second machine, that shutli.pyc is missing in that zip file as
    > > a result fo which I am unable to use that library on the second
    > > machine. When I use it, it throws an error:

    >
    > > ImportError: No module named shutil

    >
    > > Can some one please suggest me a solution for this.

    >
    > Are you sure it's the same script? The same setup.py? The same py2exe  
    > version? Aren't you sharing the same directory for several projects?
    >
    > --
    > Gabriel Genellina


    Thanks for the reply.. 1. It is the same script. Moreover even if the
    scripts change, if my script uses that module, shouldn't it be there
    in that zip. 2. I've used the same installer on the second machine
    too. 3. No, am not sharing the directory.
    Another observation I made is, if I copy the library.zip file
    from the first machine to the second machine, these script runs
    without any exception. But I can't every time copy the zip.:-(

    Thank you once again,
    Venu Madhav.
     
    , Mar 4, 2009
    #3
  4. En Wed, 04 Mar 2009 11:38:35 -0200,
    <> escribió:
    > On Mar 4, 6:23 pm, "Gabriel Genellina" <> wrote:
    >> En Wed, 04 Mar 2009 11:12:32 -0200,  
    >> <> escribió:
    >>
    >> >             I am facing an interesting problem with py2exe conversion.
    >> > I've a python script which uses the shutil libarary. When I convert
    >> > that python script into exe, it creates a dist folder and then in that
    >> > it places the exe. Along with the exe it also places a zip folder
    >> > containing pre compiled python scripts( library.zip).I have two
    >> > Win2003 machines.On one machine when I genreate the exe that zip file
    >> > also contains this shutil.pyc, but when I build the same python script
    >> > on the second machine, that shutli.pyc is missing in that zip file as
    >> > a result fo which I am unable to use that library on the second
    >> > machine. When I use it, it throws an error:

    >>
    >> > ImportError: No module named shutil

    >>
    >> > Can some one please suggest me a solution for this.

    >>
    >> Are you sure it's the same script? The same setup.py? The same py2exe  
    >> version? Aren't you sharing the same directory for several projects?

    >
    > Thanks for the reply.. 1. It is the same script. Moreover even if the
    > scripts change, if my script uses that module, shouldn't it be there
    > in that zip. 2. I've used the same installer on the second machine
    > too. 3. No, am not sharing the directory.


    No idea then, apart from a bug in py2exe. I'd delete the dist and build
    directories before regenerating the .exe, just to be sure.

    --
    Gabriel Genellina
     
    Gabriel Genellina, Mar 4, 2009
    #4
    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. F. GEIGER
    Replies:
    0
    Views:
    949
    F. GEIGER
    Aug 16, 2004
  2. Miki Tebeka
    Replies:
    2
    Views:
    423
    Miki Tebeka
    Mar 9, 2005
  3. python
    Replies:
    3
    Views:
    1,883
    Simon Brunning
    May 22, 2006
  4. Chris Spencer

    Re: [Py2exe-users] py2exe 0.6.9 released

    Chris Spencer, Nov 17, 2008, in forum: Python
    Replies:
    3
    Views:
    599
    Pascal
    Dec 8, 2008
  5. Mark Hammond

    RE: [Py2exe-users] py2exe 0.6.9 released

    Mark Hammond, Nov 17, 2008, in forum: Python
    Replies:
    0
    Views:
    479
    Mark Hammond
    Nov 17, 2008
Loading...

Share This Page