Bienvenue sur IndexError.

Ici vous pouvez poser des questions sur Python et le Framework Django.

Mais aussi sur les technos front comme React, Angular, Typescript et Javascript en général.

Consultez la FAQ pour améliorer vos chances d'avoir des réponses à vos questions.

pipenv avec wxpython : ERROR: Could not find a version that matches wxwidgets

0 votes

J'ai un projet dans lequel j' aurai besoin de youtube_dl et de wxpython (le phoenix si possible).

La contrainte : en faire un executable lancable depuis windows (sans python) , en codant depuis linux.

Je veux un espace global propre et utiliser un environnement virtuel.

J' attaque avec un pipenv pour commencer.
Puis on finira avec un pyinstaller, ou py2exe ou cxfreeze.

ça coince déjà dès le départ sur pipenv avec wxpython:

pipenv install wxPython

Installing wxPython…
Adding wxPython to Pipfile's [packages]…
✔ Installation Succeeded 
Installing dependencies from Pipfile.lock (c972a6)…
An error occurred while installing wxpython==4.0.6 --hash=sha256:0ec54278d ...

Installing initially failed dependencies…

[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches wxwidgets
[pipenv.exceptions.ResolutionFailure]:       No versions found
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
demandé 2-Jul par buffalo974 (2,840 points)
edité 2-Jul par buffalo974

1 Réponse

0 votes

Si tu vérifies, il n'y a pas de wheel pour GNU/Linux (https://pypi.org/project/wxPython/4.0.6/#files).
J'imagine que le hash de la version dans ton pipfile est celui de Windows ?

Peux-tu fournir ce fichier complet ?

répondu 5-Jul par Tiger-222 (1,110 points)

la wheel cp37 en bas:
https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/

le pipfile:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
wxpython = "*"
youtube-dl = "*"

[requires]
python_version = "3.7"

le pipfile.lock contient entre-autre:

"wxpython": {
            "hashes": [
                "sha256:0ec54278d77c2a39e0317316a9750833abd9967cc4a697d22bba3103babd0669",
                "sha256:1399b68eb7e0cdeaf50fd498beb13b2c7a6ac9d685a8bc48d7e000f3b3e524c2",
                "sha256:221ddb259f6c5546159cd4471adf4084179db9d255fbf3932397201f4810c6bc",
                "sha256:25f6ce0d736938b56a5dee5ca451ec696e8e1e6f971558d5ac2d13f3c04a4bfd",
                "sha256:2c47c641dc97d2b9fb52730aae438da32cf6fb1fbd86890fe840f8a1b815fd01",
                "sha256:35cc8ae9dd5246e2c9861bb796026bbcb9fb083e4d49650f776622171ecdab37",
                "sha256:4b99d18b24b1d603f002b3b894c65e7ef3253064e1ab15447aa5d94db1376692",
                "sha256:537e0487f5e9318c11ae88f7f5a6f2760fae741c2b90a16559fb77fc281d8445",
                "sha256:55ef084a0f295ed7ffd699cb57cdee43b22e9488929c7025370b8e26ee8e1642",
                "sha256:7bbc8b32690c1e2dc73cd739c84a00289e4cd7bf0b342ae4a4b75b5d7c43a9d7",
                "sha256:934868b08cc75bb152120ab80c75c45e2367f5135891a513743a11dfde9acbed",
                "sha256:9a93d5f644262a13223eeac86593121c768677c9ad0bfa12265c5237bf4d3fa5",
                "sha256:c199cc6974a26d3d318965852b6b713313af09ce51252c8d60fb23dcd6cd2c4b",
                "sha256:cb3d98fa5fea20a1fe39fce91d4be9a50cf90c00c35fcc9c66513d3fe727fdf9",
                "sha256:d0ffbff3b00d49eb43e144190ba279e6524a3ee5106feadec53efa66c6fb02c5",
                "sha256:f45faaf2456d1d3f32a0b9ec72ee8b36a47b64f4888961e4d4440066d7b2c75f"
            ],
            "index": "pypi",
            "version": "==4.0.6"
        },
        "youtube-dl": {
            "hashes": [
                "sha256:36da83abcde378d4de838d55d25b90c4a3ca37843efa20007898646df14b5575",
                "sha256:829fc833d8cc4a24c883fa49fd450d06b29fb17cddcb885314af92da220234f1"
            ],
            "index": "pypi",
            "version": "==2019.7.2"
        }

théoriquement je n'aurai pas eu besoin de wheel car la je pourri mon espace global.
Actuellement je n'utilise pas l' environement virtuel quand j ai besoin de wx car ça ne marche pas sinon.

je me rend compte que ça baragouine sur 3.6 alors que je lui parle de 3.7
J ' ai la 3.6 d' origine et j'arrive à faire des scripts 3.7 car j'ai installé
la 3.7 sans probleme.

pipenv --python 3.7.3 install wxPython youtube_dl


Installing initially failed dependencies…
[pipenv.exceptions.InstallError]:   File "/home/buffalo/.local/lib/python3.6/site-packages/pipenv/core.py", line 1992, in do_install
[pipenv.exceptions.InstallError]:       skip_lock=skip_lock,
[pipenv.exceptions.InstallError]:   File "/home/buffalo/.local/lib/python3.6/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "/home/buffalo/.local/lib/python3.6/site-packages/pipenv/core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]:       retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]:   File "/home/buffalo/.local/lib/python3.6/site-packages/pipenv/core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]:   File "/home/buffalo/.local/lib/python3.6/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ['Collecting wxpython==4.0.6 (from -r /tmp/pipenv-jvm0zcb9-requirements/pipenv-cxg9iymg-requirement.txt (line 1))', '  Using cached https://files.pythonhosted.org/packages/9a/a1/9c081e04798eb134b63def3db121a6e4436e1d84e76692503deef8e75423/wxPython-4.0.6.tar.gz', 'Building wheels for collected packages: wxpython', '  Building wheel for wxpython (setup.py): started', "  Building wheel for wxpython (setup.py): finished with status 'error'", '  Running setup.py clean for wxpython', 'Failed to build wxpython', 'Installing collected packages: wxpython', '  Running setup.py install for wxpython: started', "    Running setup.py install for wxpython: finished with status 'error'"]
[pipenv.exceptions.InstallError]: ['ERROR: Complete output from command /home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/bin/python3.7m -u -c \'import setuptools, tokenize;__file__=\'"\'"\'/tmp/pip-install-ig3irfav/wxpython/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' bdist_wheel -d /tmp/pip-wheel-uf9jkl_f --python-tag cp37:', '  ERROR: running bdist_wheel', '  running build', '  WARNING: Building this way assumes that all generated files have been', '  generated already.  If that is not the case then use build.py directly', '  to generate the source and perform the build stage.  You can use', '  --skip-build with the bdist_* or install commands to avoid this', '  message and the wxWidgets and Phoenix build steps in the future.', '  ', '  "/home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/bin/python3.7m" -u build.py build', '  Traceback (most recent call last):', '    File "build.py", line 30, in <module>', '      import pathlib2', "  ModuleNotFoundError: No module named 'pathlib2'", '  Command \'"/home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/bin/python3.7m" -u build.py build\' failed with exit code 1.', '  ----------------------------------------', '  ERROR: Failed building wheel for wxpython', '    ERROR: Complete output from command /home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/bin/python3.7m -u -c \'import setuptools, tokenize;__file__=\'"\'"\'/tmp/pip-install-ig3irfav/wxpython/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' install --record /tmp/pip-record-0dr7sqa_/install-record.txt --single-version-externally-managed --compile --install-headers /home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/include/site/python3.7/wxpython:', '    ERROR: running install', '    running build', '    WARNING: Building this way assumes that all generated files have been', '    generated already.  If that is not the case then use build.py directly', '    to generate the source and perform the build stage.  You can use', '    --skip-build with the bdist_* or install commands to avoid this', '    message and the wxWidgets and Phoenix build steps in the future.', '    ', '    "/home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/bin/python3.7m" -u build.py build', '    Traceback (most recent call last):', '      File "build.py", line 30, in <module>', '        import pathlib2', "    ModuleNotFoundError: No module named 'pathlib2'", '    Command \'"/home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/bin/python3.7m" -u build.py build\' failed with exit code 1.', '    ----------------------------------------', 'ERROR: Command "/home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/bin/python3.7m -u -c \'import setuptools, tokenize;__file__=\'"\'"\'/tmp/pip-install-ig3irfav/wxpython/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' install --record /tmp/pip-record-0dr7sqa_/install-record.txt --single-version-externally-managed --compile --install-headers /home/buffalo/.local/share/virtualenvs/x-UkHkyAvu/include/site/python3.7/wxpython" failed with error code 1 in /tmp/pip-install-ig3irfav/wxpython/']
ERROR: ERROR: Package installation failed...
...