Как исправить «ImportError: Невозможно связать пространство имен» для некоторых подпапок в пакете? - PullRequest
0 голосов
/ 04 июня 2019

Я пытаюсь собрать установщик .exe моего проекта на Python (PyQT5) в Windows 10.

В моей основной папке ( 'diplom_release' ) у меня есть несколько .pyфайлы и несколько других папок: 'design' (.ui файл), 'data' (есть несколько папок с файлами .bmp, .png, .sav), 'test' (пусто).

Когда я запускаю в CMD из папки до 'diplom_release':

pynsist installer.cfg

Iполучил:

ImportError: Cannot bundle namespace package 'diplom_release'

Я пробовал pyinstaller, но было слишком много проблем с нерелевантными библиотеками, и я решил выбрать другой путь.

У меня есть installer.cfg:

[Application]
name='Liver texture statistics analyzer'
version=0.1
# How to launch the app - this calls the 'main' function from the 'diplom_release' package:
entry_point=diplom_release:main
icon=ltsa.ico

[Python]
version=3.6.1

[Include]
# Packages from PyPI that your application requires, one per line
packages = diplom_release

# These must have wheels on PyPI:
pypi_wheels = requests==2.18.4
     pyqt5==5.9.2
     matplotlib==3.1.0
     pandas==0.24.2
     numpy==1.16.3
     pillow==5.2.0
     pynrrd==0.4.0
     pyradiomics==2.1.2
     seaborn==0.9.0
     scikit-learn==0.21.1

# Other files and folders that should be installed
files = diplom_release\radiomics_single.py
    diplom_release\data_reader.py
    diplom_release\classification.py
    diplom_release\mplwidget.py
    diplom_release\data\result\model\Logistic Regression diagnosis_code.sav
    diplom_release\data\result\model\Logistic Regression isauh.sav
    diplom_release\data\result\model\Logistic Regression ishpc.sav
    diplom_release\data\result\model\Logistic Regression ishpb.sav
    diplom_release\data\result\model\Logistic Regression iswls.sav
    diplom_release\data\result\model\Logistic Regression isnorm.sav
...