मैंने अपनी modeltest.py फ़ाइल को exe में बदलने के लिए pyinstaller का उपयोग किया। इसे निष्पादित करते समय मुझे मिल गया

AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython__'

मैं इंटरनेट पर समाधान का जिक्र करने के बाद scipy 1.1.0 और Cython 0.28.3 का उपयोग कर रहा हूं। मैंने Cython को अपडेट करने का प्रयास किया है, लेकिन कोई भाग्य नहीं था।

इसे हल करने के लिए कोई सुझाव या .py को exe में बदलने का बेहतर तरीका? मैंने py2exe को python3.5 के साथ एक नए env में आज़माया है, जिसे टेंसरफ़्लो के लिए अनुशंसित किया जाता है। लेकिन एक घंटे के अध्ययन के बाद, हर बार जब मैं cmd ​​में python setup.py py2exe दर्ज करता हूं तो यह सिर्फ running py2exe देता है और कोई प्रतिक्रिया नहीं।

मैंने अधिक डिबगिंग आउटपुट प्राप्त करने के लिए इसे cx_freeze के साथ फ्रीज करने का प्रयास किया लेकिन कुछ भी नहीं है। पूरी तरह से खाली, कोई त्रुटि नहीं, कोई लॉग नहीं, जैसे मैंने अभी कुछ भी दर्ज नहीं किया है।

नीचे pyinstall से पूर्ण लॉग:

Using TensorFlow backend.
Traceback (most recent call last):
  File "testmodel.py", line 5, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\__init__.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\datasets\__init__.py", line 4, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\datasets\imdb.py", line 8, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\preprocessing\__init__.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\preprocessing\image.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras_preprocessing\image.py", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\ndimage\__init__.py", line 161, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\ndimage\filters.py", line 38, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\ndimage\_ni_docstrings.py", line 4, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\misc\__init__.py", line 68, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\interpolate\__init__.py", line 175, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\interpolate\interpolate.py", line 32, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "c:\programdata\anaconda3\envs\tfgpu\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
    module = loader.load_module(fullname)
  File "stringsource", line 104, in init scipy.interpolate.interpnd
AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython__'
[9828] Failed to execute script testmodel

अपडेट करें: मैंने मिस्टर जे की सूची के रूप में Cython और pandas के संस्करण को बदल दिया:

Cython==0.27.3
h5py==2.8.0
Keras==2.2.0
Keras-Applications==1.0.2
Keras-Preprocessing==1.0.1
numpy==1.14.5
pandas==0.20.3
PyInstaller==3.3.1
pypiwin32==223
python-dateutil==2.7.3
pytz==2018.5
pywin32==223
PyYAML==3.13
scipy==1.1.0
six==1.11.0
tensorboard==1.9.0
tensorflow-gpu==1.9.0
UNKNOWN==0.0.0

त्रुटि no attribute '__reduce_cython__' चली गई है, यह नई त्रुटि आती है:

Using TensorFlow backend.
Traceback (most recent call last):
  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
  File "importlib\__init__.py", line 126, in import_module
ImportError: Module use of python36.dll conflicts with this version of Python.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "testmodel.py", line 5, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\__init__.py", line 3, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\utils\__init__.py", line 6, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\utils\conv_utils.py", line 9, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\backend\__init__.py", line 87, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\backend\tensorflow_backend.py", line 5, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\__init__.py", line 22, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\__init__.py", line 49, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
ImportError: Traceback (most recent call last):
  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  File "c:\programdata\anaconda3\envs\tensorflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
  File "importlib\__init__.py", line 126, in import_module
ImportError: Module use of python36.dll conflicts with this version of Python.


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
[8216] Failed to execute script testmodel

अद्यतन: मैं win7 पर python3.6 हटा देता हूं, यह अभी भी काम नहीं कर रहा है।

नीचे लॉग इन करें:

Traceback (most recent call last):
  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
  File "importlib\__init__.py", line 126, in import_module
ImportError: DLL load failed: The specified module could not be found.
    During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "testmodel.py", line 5, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\__init__.py", line 3, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\utils\__init__.py", line 6, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\utils\conv_utils.py", line 9, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\backend\__init__.py", line 87, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\backend\tensorflow_backend.py", line 5, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\__init__.py", line 22, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\__init__.py", line 49, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
ImportError: Traceback (most recent call last):
  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
  File "importlib\__init__.py", line 126, in import_module
ImportError: DLL load failed: The specified module could not be found.


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
[4840] Failed to execute script testmodel

अपडेट करें: मुझे Anaconda3\envs\<my_envs_name>\Lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py से संबंधित समस्या का पता चला और यह मेरे कोड में इस लाइन के कारण इस फ़ाइल को निष्पादित करने का प्रयास करता है: from keras.model import load_model (यदि मैं इस लाइन को # के साथ टिप्पणी करने के लिए बदल देता हूं, तो मैं सफलतापूर्वक .exe फ़ाइल चला सकता हूं)

नीचे pywrap_tensorflow_internal.py में टुकड़ा:

(मैं डिबग के लिए print(error) सम्मिलित करता हूं, मुझे लगता है कि यह फ़ंक्शन समस्या का कारण बनता है)

from sys import version_info
if version_info >= (2, 7, 0):
    def swig_import_helper():
        print('Error!') 
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_pywrap_tensorflow_internal')).lstrip('.')
        return importlib.import_module(mname)
    _pywrap_tensorflow_internal = swig_import_helper()
    del swig_import_helper
elif version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
        except ImportError:
            import _pywrap_tensorflow_internal
            return _pywrap_tensorflow_internal
        if fp is not None:
            try:
                _mod = imp.lo

ad_module('_pywrap_tensorflow_internal', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _pywrap_tensorflow_internal = swig_import_helper()
    del swig_import_helper
else:
    import _pywrap_tensorflow_internal
del version_info
try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

अपडेट करें: मैंने dist\project_name\ फ़ोल्डर में _pywrap_tensorflow_internal.pyd का फ़ाइल नाम बदल दिया --- जो कि pyinstaller द्वारा tensorflow.python._pywrap_tensorflow_internal.pyd में जेनरेट किया गया।

और ऐसा लगता है कि शुरुआत की समस्या पर वापस चला गया: AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython__' लॉग के बीच बस थोड़ा सा अंतर है।

लॉग:

Traceback (most recent call last):
  File "testmodel.py", line 5, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\__init__.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\datasets\__init__.py", line 4, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\datasets\imdb.py", line 8, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\preprocessing\__init__.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras\preprocessing\image.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\keras_preprocessing\image.py", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\ndimage\__init__.py", line 161, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\ndimage\filters.py", line 38, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\ndimage\_ni_docstrings.py", line 4, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\misc\__init__.py", line 68, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\interpolate\__init__.py", line 175, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\scipy\interpolate\interpolate.py", line 32, in <module>
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "c:\programdata\anaconda3\envs\pyinstaller\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
    module = loader.load_module(fullname)
  File "stringsource", line 104, in init scipy.interpolate.interpnd
AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython__'

अद्यतन: मैंने इसे pyinstaller के नवीनतम विकास संस्करण का उपयोग करके हल किया था। मुझे ये दिशा तब मिली जब मैं गीथब पर pyinstaller के पेज पर नया मुद्दा खोलने की कोशिश कर रहा था:

If you have problems to get your application running, please first

* try the latest development version, using the following command:

shell
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

फिर भी, मुझे अभी भी dist\<porject_name>फ़ोल्डर में मैन्युअल रूप से कुछ फ़ाइलें जोड़ने की आवश्यकता है, जिनमें से Keras``Keras_applications``Keras_preprocessing``tensorflow फ़ोल्डर शामिल हैं C:\Users\Administrator\AppData\Local\Programs\Python\Python35\Lib\site-packages

और डीएलएल फाइलें C:\Users\Administrator\AppData\Local\Programs\Python\Python35\Lib\site-packages\scipy\extra-dll

इसलिए मैं यह जानने के लिए अध्ययन करता रहूंगा कि सभी फाइलों को एक .exe फ़ाइल में कैसे पैकेज किया जाए।

2
Greengene Chung 19 जुलाई 2018, 11:23
आपकी मशीन पर tensorflow और scipy का कौन सा संस्करण स्थापित है, कृपया हमें बताएं कि आप किस ओएस के साथ काम कर रहे हैं।
 – 
Mr. J
19 जुलाई 2018, 13:59
आपके पास पांडा-0.20.3, साइथन-0.27.3 और पायथन-3.5 का उपयोग करके नीचे सूचीबद्ध न्यूनतम संस्करण होना चाहिए।
 – 
Mr. J
19 जुलाई 2018, 14:03
आपकी मदद के लिए धन्यवाद, cython समस्या हल हो गई है, लेकिन अब मुझे ImportError: Module use of python36.dll conflicts with this version of Python. मिल गया है। मैंने टेंसरफ़्लो इंस्टॉलेशन पेज की जाँच की। Tensorflow-gpu 1.9.0 को python 3.5~3.6 द्वारा समर्थित होना चाहिए।
 – 
Greengene Chung
20 जुलाई 2018, 04:39
मुझे लगता है कि आपके मशीन पर आपके पास पाइथन के विभिन्न संस्करण स्थापित हैं। अजगर के साथ जांचें
 – 
Mr. J
20 जुलाई 2018, 05:36
मैं फ़ाइल को वर्चुअल एनवी में python3.6 के साथ प्रोग्राम करता हूं और इसे python 3.5.5 के साथ दूसरे में परिवर्तित करता हूं। क्या यही इस समस्या का कारण है?
 – 
Greengene Chung
20 जुलाई 2018, 05:39

1 उत्तर

सबसे बढ़िया उत्तर

मैं इसे नीचे दिए गए चरणों के साथ हल करता हूं:

सबसे पहले: pyinstaller के नवीनतम विकास संस्करण का उपयोग करें।

If you have problems to get your application running, please first

* try the latest development version, using the following command:

shell
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

सुनिश्चित करें कि कोई अन्य python interpreter नहीं है जो आपके सिस्टम में हस्तक्षेप करता है। और python pandas cython scipy का संगत संस्करण ढूंढें। dist\<project_name> फ़ोल्डर में निहित _pywrap_tensorflow_internal.pyd फ़ाइल का नाम बदलकर tensorflow.python._pywrap_tensorflow_internal.pyd कर दें।

फिर कॉपी करें tensorflow फ़ोल्डर C:\Users\Administrator\AppData\Local\Programs\Python\Python35\Lib\site-packages से

और डीएलएल फाइलें C:\Users\Administrator\AppData\Local\Programs\Python\Python35\Lib\site-packages\scipy\extra-dll से करने के लिए dist\<project_name>

2
Greengene Chung 24 जुलाई 2018, 05:50