Open steveharman opened 5 years ago
This seems like an error with py2app
. I'm not at my computer right now, but I'll investigate later. It could also help to report this error to the py2app developers.
Thanks @mdbraber - I just updated my ticket with a little more detail.
@steveharman are you possibly using PYTHONPATH to specific modules? If so you should use the --use-pythonpath
option like described here: https://py2app.readthedocs.io/en/latest/options.html
@steveharman here's an approach to debug Python issues:
This is a general guide to debugging setup.py issues, or actually python issues in general (copied from: https://stackoverflow.com/questions/16131500/py2app-error-in-find-needed-modules-typeerror-nonetype-object-has-no-attribu)
python3 -i setup.py py2app
. Once setup.py
exits you will find yourself in a python prompt.from pdb import pm; pm()
. You should now find yourself at a debug prompt.I'm really sorry @mdbraber I simply don't have time to go into resolving this right now. I've never knowingly touched Python before, I just wanted a menubar radio app for my Mac. ;-)
@steveharman unfortunately as I can't reproduce the issue it might be due to your local environment. I'll try to investigate a bit more and see if I can reproduce. One question: did you install python3 using brew?
perfectly understood @mdbraber
and yes to python3 via brew
happy to help debug if there are some quickfire "do this, try this, let me know" steps.
Hi @mdbraber
I tried the steps you mentioned, here's my output:
running py2app
creating /Users/steveharman/radiobar/build/bdist.macosx-10.14-x86_64/python3.7-standalone/app
creating /Users/steveharman/radiobar/build/bdist.macosx-10.14-x86_64/python3.7-standalone/app/collect
creating /Users/steveharman/radiobar/build/bdist.macosx-10.14-x86_64/python3.7-standalone/app/temp
creating build/bdist.macosx-10.14-x86_64/python3.7-standalone/app/lib-dynload
creating build/bdist.macosx-10.14-x86_64/python3.7-standalone/app/Frameworks
Traceback (most recent call last):
File "setup.py", line 26, in <module>
setup_requires=['py2app'],
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.7/site-packages/py2app/build_app.py", line 838, in run
self._run()
File "/usr/local/lib/python3.7/site-packages/py2app/build_app.py", line 1053, in _run
self.run_normal()
File "/usr/local/lib/python3.7/site-packages/py2app/build_app.py", line 1146, in run_normal
mf = self.get_modulefinder()
File "/usr/local/lib/python3.7/site-packages/py2app/build_app.py", line 997, in get_modulefinder
debug=debug,
File "/usr/local/lib/python3.7/site-packages/modulegraph/find_modules.py", line 338, in find_modules
find_needed_modules(mf, scripts, includes, packages)
File "/usr/local/lib/python3.7/site-packages/modulegraph/find_modules.py", line 256, in find_needed_modules
path = m.packagepath[0]
TypeError: 'NoneType' object is not subscriptable
>>> from pdb import pm; pm()
> /usr/local/lib/python3.7/site-packages/modulegraph/find_modules.py(256)find_needed_modules()
-> path = m.packagepath[0]
(Pdb) up
> /usr/local/lib/python3.7/site-packages/modulegraph/find_modules.py(338)find_modules()
-> find_needed_modules(mf, scripts, includes, packages)
(Pdb) list
333 path=path,
334 excludes=(excludes - includes),
335 implies=get_implies(),
336 debug=debug,
337 )
338 -> find_needed_modules(mf, scripts, includes, packages)
339 return mf
[EOF]
(Pdb)```
Afraid I have no knowledge of "PYTHONPATH".
Steve
The following steps resulted in a working app for me:
Make sure you install python via pyenv with the following flag (to get the dylib):
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.7.4
Delete the setup.py and make a new one
py2applet --make-setup radiobar.py
Build the app using py2app
python -i setup.py py2app
Could you explain how I accomplish item 1 in your list of steps please @wasbeer ?
Thanks
I come bak to this from time to time, to see if the errors I have go away, but I think this is y final attempt.
And I get:
python3 setup.py py2app
running py2app
creating /Users/steveharman/radiobar/build/bdist.macosx-10.15-x86_64/python3.7-standalone
creating /Users/steveharman/radiobar/build/bdist.macosx-10.15-x86_64/python3.7-standalone/app
creating /Users/steveharman/radiobar/build/bdist.macosx-10.15-x86_64/python3.7-standalone/app/collect
creating /Users/steveharman/radiobar/build/bdist.macosx-10.15-x86_64/python3.7-standalone/app/temp
creating build/bdist.macosx-10.15-x86_64/python3.7-standalone/app/lib-dynload
creating build/bdist.macosx-10.15-x86_64/python3.7-standalone/app/Frameworks
Traceback (most recent call last):
File "setup.py", line 26, in <module>
setup_requires=['py2app'],
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/steveharman/radiobar/.eggs/py2app-0.19-py3.7.egg/py2app/build_app.py", line 838, in run
self._run()
File "/Users/steveharman/radiobar/.eggs/py2app-0.19-py3.7.egg/py2app/build_app.py", line 1053, in _run
self.run_normal()
File "/Users/steveharman/radiobar/.eggs/py2app-0.19-py3.7.egg/py2app/build_app.py", line 1146, in run_normal
mf = self.get_modulefinder()
File "/Users/steveharman/radiobar/.eggs/py2app-0.19-py3.7.egg/py2app/build_app.py", line 997, in get_modulefinder
debug=debug,
File "/Users/steveharman/radiobar/.eggs/modulegraph-0.17-py3.7.egg/modulegraph/find_modules.py", line 338, in find_modules
find_needed_modules(mf, scripts, includes, packages)
File "/Users/steveharman/radiobar/.eggs/modulegraph-0.17-py3.7.egg/modulegraph/find_modules.py", line 256, in find_needed_modules
path = m.packagepath[0]
TypeError: 'NoneType' object is not subscriptable
@steveharman did you try pip3 install modulegraph
?
I don't know what modulegraph
is but I used pip3
to install py2app. Is it relevant that I never get any success with the shortened version of py2app
from terminal, only the full py2applet
command
➜ radiobar git:(master) py2applet
usage: py2applet --make-setup [options...] script.py [data files...]
or: py2applet [options...] script.py [data files...]
or: py2applet --help
➜ radiobar git:(master) py2app
zsh: command not found: py2app
➜ radiobar git:(master)
py2app is not an independent command afaik (you run it through python setup.py py2app
. py2applet
is an independent command so what you have looks okay. I'm guessing it's some kind of versioning problem. Can you try installing the dev versions of the modules as mentioned here: https://mail.python.org/pipermail/pythonmac-sig/2008-September/020471.html
easy_install -U modulegraph==dev
easy_install -U py2app==dev
macOS 10.14. Python 3.7.2 (also tried with Python 2.7.10)
I get
'NoneType' object is not subscriptable ?
frompython3 setup.py py2app
- can anyone help please? setup seems to be complaining aboutpy2app
being required, but afaict I already have it?and:
Here's setup's full complaint:
Thanks,