Reputation: 562
I'm currently working on a personal project with Tkinter and I want to wrap everything into a macOS app.
Unfortunately, the command to create a production build not working and I always have an error related to "Modules not found"
Modules not found (conditional imports):
* ConfigParser (dogpile.util.compat)
* Cookie (requests.compat)
* OpenSSL.crypto (urllib3.contrib.pyopenssl)
* Queue (urllib3.util.queue)
* StringIO (dogpile.util.compat, pkg_resources._vendor.six, requests.compat, six, urllib3.packages.six)
* backports.functools_lru_cache (soupsieve.util)
* cPickle (dogpile.util.compat)
* colors (tkmacosx.variables)
* com (pkg_resources._vendor.appdirs)
* com.sun.jna (pkg_resources._vendor.appdirs)
* com.sun.jna.platform (pkg_resources._vendor.appdirs)
* cookielib (requests.compat)
* copy_reg (soupsieve.util)
* cryptography.x509.extensions (urllib3.contrib.pyopenssl)
* regex (rebulk.remodule)
* sympy (subliminal.score)
* thread (dogpile.util.compat)
* urllib2 (requests.compat)
* urlparse (requests.compat)
* win32com (pkg_resources._vendor.appdirs)
* win32com.shell (pkg_resources._vendor.appdirs)
* yaml (guessit.options)
I've tried many workaround but nothing works..
The modules I use :
tkinter
subliminal
tkmacosx
Upvotes: 0
Views: 1646
Reputation: 114
Always check the version of pip and python you are using!
I had an similar issue where tkmacosx
could not be imported.
Turned out I was using [email protected] but [email protected]
So using:
pip3.11 install tkmacosx
solved it for me
Upvotes: 2
Reputation: 2820
The message about modules that weren't found is a warning, not an error. These may or may not be problem, but often aren't. In particular the missing optional modules that are used from the various "compat" modules are almost certainly harmless if you use Python 3 (because those are imports of names in the Python 2 stdlib).
At first glance the missing "sympy", "regex" and "yaml" could be problematic, you could try installing these python packages.
As a bit of background, PyObjC shows 3 lists of missing modules at the end of a build (assuming there are missing modules in the category):
Unconditional imports: These are imports that are always executed when a module is imported (toplevel imports and imports in class scope)
These tend to be problematic, unless the module containing the import is itself optional.
Conditional imports: These are imports that are conditional, either because they are done in a function or because they are in some sort of conditional statement.
These tend to be harmless.
Missing names in a "from FOO import NAME" statement: In these statements the "NAME" can refer to modules or to definitions in the imported module. Py2app reports these when it is not 100% clear that NAME refers to a module.
These tend to be harmless, especially when the module ("FOO") is a C extension.
Upvotes: 1