Py2app возвращает ошибку «Модули не найдены (условный импорт):» при попытке скомпилировать игру на Python для приложения Mac OSX - PullRequest
0 голосов
/ 12 октября 2018

В настоящее время у меня есть скрипт на python, который я пытаюсь скомпилировать в приложение Mac OSX, используя py2app.В моей игре у меня есть два файла с изображениями для игры, которые называются data и resources.Я использую следующий скрипт установки

# setup.py
from setuptools import setup
DATA_FILES = ['data','resources']
setup(
    app=["mygame.py"],
    data_files=DATA_FILES,
setup_requires=["py2app"],
)

Если я выполняю псевдоним, как в:

python3 setup.py py2app -A

, игра запускается.Тем не менее, я хотел бы автономную версию.Когда я запускаю:

python3 setup.py py2app

, это дает следующие ошибки:

 Modules not found (conditional imports):
 * ConfigParser (numpy.distutils.npy_pkg_config, numpy.distutils.system_info)
 * Dialog (OpenGL.Tk)
 * Numeric (numpy.distutils.system_info)
 * OpenGL_accelerate.arraydatatype (OpenGL.arrays.arraydatatype, OpenGL.arrays.arrayhelpers, OpenGL.converters)
 * OpenGL_accelerate.buffers_formathandler (OpenGL.arrays.buffers)
 * OpenGL_accelerate.errorchecker (OpenGL.error)
 * OpenGL_accelerate.latebind (OpenGL.latebind, OpenGL.wrapper)
 * OpenGL_accelerate.nones_formathandler (OpenGL.arrays.nones)
 * OpenGL_accelerate.numpy_formathandler (OpenGL.arrays.numpymodule)
 * OpenGL_accelerate.vbo (OpenGL.arrays.vbo)
 * OpenGL_accelerate.wrapper (OpenGL.arrays.arrayhelpers, OpenGL.converters, OpenGL.wrapper)
 * Py25Queue (pygame.threads)
 * Queue (numpy.fft.tests.test_fftpack, pygame.threads)
 * StringIO (numpy.core.tests.test_print, numpy.distutils.tests.test_exec_command, numpy.lib.format, numpy.lib.tests.test_regression, numpy.lib.tests.test_utils, numpy.lib.utils, numpy.testing._private.utils, pkg_resources._vendor.six)
 * Tkinter (OpenGL.Tk)
 * _distutils_findvs (distutils._msvccompiler)
 * _manylinux (setuptools.pep425tags)
 * cPickle (numpy.core.numeric, numpy.lib.format, numpy.lib.npyio, numpy.ma.core)
 * cStringIO (pygame.compat)
 * com (pkg_resources._vendor.appdirs)
 * com.sun.jna (pkg_resources._vendor.appdirs)
 * com.sun.jna.platform (pkg_resources._vendor.appdirs)
 * commands (numpy.distutils.cpuinfo)
 * copy_reg (numpy.core, pygame)
 * dummy_thread (numpy.core.arrayprint)
 * f2py2e (numpy.f2py.__main__)
 * future_builtins (numpy.lib.npyio, numpy.lib.recfunctions)
 * md5 (numpy.core.tests.test_regression)
 * nose (numpy.testing._private.decorators, numpy.testing._private.utils, numpy.testing.tests.test_decorators, numpy.testing.tests.test_doctesting)
 * nose.plugins (numpy.testing._private.nosetester)
 * nose.plugins.builtin (numpy.testing._private.nosetester)
 * numarray (numpy.distutils.system_info)
 * numpy_distutils (numpy.f2py.diagnose)
 * numpy_distutils.command.build_flib (numpy.f2py.diagnose)
 * numpy_distutils.command.cpuinfo (numpy.f2py.diagnose)
 * numpy_distutils.cpuinfo (numpy.f2py.diagnose)
 * numpy_distutils.fcompiler (numpy.f2py.diagnose)
 * pygame._view ()
 * pytest (numpy.testing._private.pytesttester)
 * scipy (numpy.testing._private.nosetester)
 * thread (numpy.core.arrayprint)
 * urllib2 (numpy.lib._datasource, numpy.lib.tests.test__datasource)
 * urlparse (numpy.lib._datasource, numpy.lib.tests.test__datasource)
 * win32com (pkg_resources._vendor.appdirs)
 * win32com.shell (pkg_resources._vendor.appdirs)
 * win32pdh (numpy.testing._private.utils)
 * wincertstore (setuptools.ssl_support)

Modules with syntax errors:
 * OpenGL.GL.SGIX.async

Я действительно не уверен, что делать.Я установил все эти модули и понятия не имею, почему они жалуются.Кто-нибудь знает почему?

...