takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
896 stars 119 forks source link

Including packages with no wheels #151

Closed torank closed 6 years ago

torank commented 6 years ago

Hi, I'm trying to create an installer for a rather large python program and I'm having trouble importing all the required packages. For example, when I want to import et-xmlfile==1.0.1 I get this error message: raise NoWheelError('No compatible wheels found for {0.name} {0.version}'.format(self)) nsist.pypi.NoWheelError: No compatible wheels found for et-xmlfile 1.0.1 I tried including it under packages instead but don't know exactly how to do this. Is it enough to write packages = et-xmlfile? If I do this, I get this error message: raise ImportError('Could not find %r' % modname) ImportError: Could not find 'et-xmlfile'

I've tried moving the folder containing et-xmlfile up to the same level as the installer.cfg-file but I get the same error message. Should "et-xmlfile" just be a single file? When downloading it with pip I get two folders; "et_xmlfile" and "et_xmlfile-1.0.1-py3.6.egg-info". I assume I should at least include everything in the "et_xmlfile"-folder in my installer but I seem unable to do this.

Underneath is the complete installer file, those modules which are commented out under "pypi_wheels", didn't have a wheel and so I've included in "packages".

[Application]
name=CardioMiner
version=1.0
entry_point=Start:main

[Python]
version=3.6.5

[Include]
pypi_wheels = altgraph==0.15
    bleach==2.1.2
    certifi==2018.1.18
    chardet==3.0.4
    click==6.7
    colorama==0.3.9
    cx-Freeze==5.1.1
    cycler==0.10.0
    decorator==4.1.2
#   dill==0.2.7.1
    Django==2.0.1
    entrypoints==0.2.3
#   et-xmlfile==1.0.1
    Faker==0.8.11
    Flask==0.12.2
#   future==0.16.0
#   gi==1.2
    h5py==2.7.1
    hdf5storage==0.1.14
    html5lib==1.0.1
    idna==2.6
    image==1.5.17
    ipykernel==4.8.0
    ipython==6.2.1
    ipython-genutils==0.2.0
    ipywidgets==7.1.1
#   itsdangerous==0.24
#   jdcal==1.3
    jedi==0.11.1
    Jinja2==2.10
    jsonschema==2.6.0
    jupyter-client==5.2.2
    jupyter-core==4.4.0
    macholib==1.9
#   MarkupSafe==1.0
#   matlab==0.1
    matplotlib==2.0.2
    mistune==0.8.3
#   mritopng==2.1
    nbconvert==5.3.1
    nbformat==4.4.0
    #networkx==2.0
    notebook==5.4.0
#   np==1.0.2
    numexpr==2.6.4
    #numutil==0.1.0
    #olefile==0.44
    opencv-python==3.3.0.10
#   openpyxl==2.4.9
    pandas==0.20.3
    #pandocfilters==1.4.2
    parso==0.1.1
#   pefile==2017.11.5
    pickleshare==0.7.4
    Pillow==4.2.1
#   plotly==2.3.0
    prompt-toolkit==1.0.15
    #pydicom==0.9.9
    Pygments==2.2.0
#   PyInstaller==3.3.1
    pyparsing==2.2.0
#   pypng==0.0.18
    PyQt5==5.9.1
    #pyreadline==2.1
    python-dateutil==2.6.1
    pytz==2017.2
    PyWavelets==0.5.2
    pywin32==223
    pywinpty==0.5.1
    pyzmq==16.0.4
    #qtgui==0.0.1
    report==0.0.1
    requests==2.18.4
    #sc-pylibs==0.1.4
    scikit-image==0.13.1
    Send2Trash==1.4.2
#   simplegeneric==0.8.1
    sip==4.19.5
    six==1.10.0
    tables==3.4.2
    terminado==0.8.1
    testpath==0.3.1
    text-unidecode==1.1
    tornado==4.5.3
    traitlets==4.3.2
    urllib3==1.22
    virtualenv==15.1.0
    wcwidth==0.1.7
    webencodings==0.5.1
    Werkzeug==0.12.2
    widgetsnbextension==3.1.3
    XlsxWriter==1.0.2
    xlwt==1.3.0
    numpy==1.14.3
    scipy==1.0.1

packages = dill
    xmlfile
    future
    gi
    itsdangerous
    jdcal
    MarkupSafe
    matlab
    mritopng
    networkx
    np
    numutil
    olefile 
    openpyxl
    pandocfilters
    pefile
    plotly
    pydicom
    PyInstaller
    pypng
    pyreadline
    qtgui
    sc-pylibs
    simplegeneric
takluyver commented 6 years ago

If you put it in packages, it has to be the importable name, which can't include dashes. It sounds like that might be et_xmlfile in your case.

Another option is to put it in the pynsist_pkgs directory. Or make a wheel yourself and point extra_wheel_sources to the directory you put it in.

torank commented 6 years ago

Ok, when using the pynsist_pkgs directory, do I have to include it somewhere in the installer.cfg-file? Or will it automatically include the directory in the installation?

takluyver commented 6 years ago

pynsist_pkgs is used automatically - it just has to be alongside the installer.cfg file.

torank commented 6 years ago

Ok, thank you for your help, I'll keep at it with these new suggestions. :)

illume commented 6 years ago

I'm wondering what sort of error message would be useful here?

What about logging these two messages? "Please make a wheel yourself for XXX and put it in YYY." "Please ask the package maintainer for XXX to upload a wheel as well."

If you think this is a good idea, I will make a PR?

(Someone was trying to make an installer with the pyscroll library which currently only has a .tar.gz file, and no wheel.)

robertpfeiffer commented 6 years ago

The error message for a misspelled/nonexistent package should be different from a nonexistent version, or from a version with no compatible wheels. Also I assumed that pynsist ~/.cache/pynsist/pypi/ caches wheels in the same place as pip ~/.cache/pip/wheels/, but that is kind of my own fault.

takluyver commented 6 years ago

Better error messages welcome, and I agree that it should be different for a nonexistent package and one that simply hasn't uploaded a compatible wheel. Maybe also one for when the package exists but the version specified doesn't?

Compatibility is important for compiled packages: they typically need to be compiled on the same platform, CPU architecture and python version that they should be used. So it's not just "does X have wheels", it's "does X have a wheel for 64-bit python 3.7 on Windows?"

Longer term, it would be best to try to build a wheel if one isn't available. But that gets complex, and there's no guarantee it will succeed.

On Tue, 14 Aug 2018, 4:41 p.m. robertpfeiffer, notifications@github.com wrote:

The error message for a misspelled/nonexistent package should be different from a nonexistent version, or from a version with no compatible wheels. Also I assumed that pynsist (/.cache/pynsist/pypi/) caches wheels in the same place as pip (/.cache/pip/wheels/), but that is kind of my own fault.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/takluyver/pynsist/issues/151#issuecomment-412896281, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUA9QYJDQq2XY-Uegi1Gud7aliU5-h2ks5uQuGxgaJpZM4Tt6ZC .