Giter Site home page Giter Site logo

Comments (1)

albertosottile avatar albertosottile commented on May 27, 2024

Hello, thanks for reporting this. It took me a while to figure out what was happening.

So, I think your question is about this entry in the build log:

running py2exe

  4 missing Modules
  ------------------
[...]
? multiprocessing.Pool                imported from __SCRIPT__

Usually, these lines are safe to ignore provided that your packaged code runs well. In this case, multiprocessing mimics a lot of its structure at the package level, probably to avoid having to type too much while using it. The "correct" way to import Pool should be from multiprocessing.pool import Pool. You can verify that the warning disappears if you change your script accordingly.

That being said, it took me a while to find this issue because your test script cannot run when packed via py2exe. At first I thought this was, as usual, a bug on my side, so I spent some time trying to make it work. Lately, I found that multiprocessing actually provides a dedicated function that must be called from inside any frozen executable (not just one built with py2exe, but also with any other tool): multiprocessing.freeze_support(). By editing your code according to the linked documentation, I was indeed able to run the test and verify that the code was functional.

In summary, you can either safely ignore the "missing Modules" warning or slightly adjust your import statement to make it disappear. However, you must add a call to multiprocessing.freeze_support() in your code to make it work when packed with py2exe.

Side note: the zipfile=None option is not supported anymore. In this case it works well, but there are other packages that will not work with this option enabled.

from py2exe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.