Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry 1.1.6 add PyQt5 error #3990

Closed
3 tasks
leileigong opened this issue Apr 23, 2021 · 3 comments
Closed
3 tasks

Poetry 1.1.6 add PyQt5 error #3990

leileigong opened this issue Apr 23, 2021 · 3 comments
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues

Comments

@leileigong
Copy link

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: win10
  • Poetry version: 1.1.6
  • Link of a Gist with the contents of your pyproject.toml file:

Poetry 1.1.6 add PyQt5==5.13.2 error

PS E:\code\fast-acas> poetry add PyQt5==5.13.2
Creating virtualenv fast-acas-qv9lkw58-py3.6 in C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs

Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 2 installs, 0 updates, 0 removals

  • Installing pyqt5-sip (12.8.1)
  • Installing pyqt5 (5.13.2)

  EnvCommandError

  Command C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\Scripts\pip.exe install --no-deps file:///C:/Users/lei/AppData/Local/pypoetry/Cache/artifacts/8e/81/16/15752af2f4272237f0381508e8e0e7c8c31aeaf5c87f7dec057878abd8/PyQt5-5.13.2-5.13.2-cp35.cp36.cp37.cp38-none-win_amd64.whl errored with the following return code 2, and output:
  Processing c:\users\lei\appdata\local\pypoetry\cache\artifacts\8e\81\16\15752af2f4272237f0381508e8e0e7c8c31aeaf5c87f7dec057878abd8\pyqt5-5.13.2-5.13.2-cp35.cp36.cp37.cp38-none-win_amd64.whl
  ERROR: Exception:
  Traceback (most recent call last):
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\cli\base_command.py", line 189, in _main
      status = self.run(options, args)
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\cli\req_command.py", line 178, in wrapper
      return func(self, options, args)
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\commands\install.py", line 317, in run
      reqs, check_supported_wheels=not options.target_dir
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 101, in resolve
      req, requested_extras=(),
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 306, in make_requirement_from_install_req
      version=None,
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 169, in _make_candidate_from_link
      name=name, version=version,
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 306, in __init__
      version=version,
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 144, in __init__
      self.dist = self._prepare()
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 226, in _prepare
      dist = self._prepare_distribution()
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 312, in _prepare_distribution
      self._ireq, parallel_builds=True,
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\operations\prepare.py", line 457, in prepare_linked_requirement
      return self._prepare_linked_requirement(req, parallel_builds)
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\operations\prepare.py", line 501, in _prepare_linked_requirement
      req, self.req_tracker, self.finder, self.build_isolation,
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\operations\prepare.py", line 67, in _get_prepared_distribution
      return abstract_dist.get_pkg_resources_distribution()
    File "C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fast-acas-qv9lkw58-py3.6\lib\site-packages\pip\_internal\distributions\wheel.py", line 30, in get_pkg_resources_distribution
      with ZipFile(self.req.local_file_path, allowZip64=True) as z:
    File "c:\python36\lib\zipfile.py", line 1108, in __init__
      self._RealGetContents()
    File "c:\python36\lib\zipfile.py", line 1175, in _RealGetContents
      raise BadZipFile("File is not a zip file")
  zipfile.BadZipFile: File is not a zip file


  at c:\python36\lib\site-packages\poetry\utils\env.py:1075 in _run
      1071│                 output = subprocess.check_output(
      1072│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1073│                 )
      1074│         except CalledProcessError as e:
    → 1075│             raise EnvCommandError(e, input=input_)
      1076│
      1077│         return decode(output)
      1078│
      1079│     def execute(self, bin, *args, **kwargs):
@leileigong leileigong added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 23, 2021
@seanwu1105
Copy link

Facing the same issue here but with PySide2 and Poetry 1.1.6. I have tried to clear the cache with poetry cache clear pypi --all. The following is the verbose error trace. The pyproject.toml file can be found in the gist.

$ poetry add PySide2 -vvv
Creating virtualenv python in /home/seanwu/vscode-qt-for-python/src/python/.venv
Using virtualenv: /home/seanwu/vscode-qt-for-python/src/python/.venv
PyPI: 22 packages found for pyside2 *
Using version ^5.15.2 for PySide2

Updating dependencies
Resolving dependencies...
   1: fact: python is 0.1.0
   1: derived: python
   1: fact: python depends on PySide2 (^5.15.2)
   1: selecting python (0.1.0)
   1: derived: PySide2 (>=5.15.2,<6.0.0)
PyPI: 1 packages found for pyside2 >=5.15.2,<6.0.0
PyPI: Getting info for pyside2 (5.15.2) from PyPI
   1: fact: pyside2 (5.15.2) depends on shiboken2 (5.15.2)
   1: selecting pyside2 (5.15.2)
   1: derived: shiboken2 (==5.15.2)
PyPI: 1 packages found for shiboken2 5.15.2
PyPI: Getting info for shiboken2 (5.15.2) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: shiboken2-5.15.2-5.15.2-cp27-cp27m-macosx_10_13_intel.whl
   1: selecting shiboken2 (5.15.2)
   1: Version solving took 7.045 seconds.
   1: Tried 1 solutions.

Writing lock file

Finding the necessary packages for the current system

Package operations: 2 installs, 0 updates, 0 removals

  • Installing shiboken2 (5.15.2): Pending...
  • Installing shiboken2 (5.15.2): Installing...
  • Installing shiboken2 (5.15.2)
  • Installing pyside2 (5.15.2): Pending...
  • Installing pyside2 (5.15.2): Installing...
  • Installing pyside2 (5.15.2): Failed

  EnvCommandError

  Command ['/home/seanwu/vscode-qt-for-python/src/python/.venv/bin/pip', 'install', '--no-deps', 'file:///home/seanwu/.cache/pypoetry/artifacts/4e/bf/d9/7479d4abd0a12ac30fc795a950d0306241a5aa9abd2c4f94ba03bbb077/PySide2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-abi3-manylinux1_x86_64.whl'] errored with the following return code 2, and output: 
  Processing /home/seanwu/.cache/pypoetry/artifacts/4e/bf/d9/7479d4abd0a12ac30fc795a950d0306241a5aa9abd2c4f94ba03bbb077/PySide2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-abi3-manylinux1_x86_64.whl
  ERROR: Exception:
  Traceback (most recent call last):
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
      status = self.run(options, args)
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
      return func(self, options, args)
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 316, in run
      requirement_set = resolver.resolve(
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 100, in resolve
      r = self.factory.make_requirement_from_install_req(
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 301, in make_requirement_from_install_req
      cand = self._make_candidate_from_link(
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 167, in _make_candidate_from_link
      self._link_candidate_cache[link] = LinkCandidate(
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 300, in __init__
      super().__init__(
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 144, in __init__
      self.dist = self._prepare()
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 226, in _prepare
      dist = self._prepare_distribution()
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 311, in _prepare_distribution
      return self._factory.preparer.prepare_linked_requirement(
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 457, in prepare_linked_requirement
      return self._prepare_linked_requirement(req, parallel_builds)
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 500, in _prepare_linked_requirement
      dist = _get_prepared_distribution(
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 67, in _get_prepared_distribution
      return abstract_dist.get_pkg_resources_distribution()
    File "/home/seanwu/vscode-qt-for-python/src/python/.venv/lib/python3.8/site-packages/pip/_internal/distributions/wheel.py", line 30, in get_pkg_resources_distribution
      with ZipFile(self.req.local_file_path, allowZip64=True) as z:
    File "/home/seanwu/.asdf/installs/python/3.8.8/lib/python3.8/zipfile.py", line 1269, in __init__
      self._RealGetContents()
    File "/home/seanwu/.asdf/installs/python/3.8.8/lib/python3.8/zipfile.py", line 1336, in _RealGetContents
      raise BadZipFile("File is not a zip file")
  zipfile.BadZipFile: File is not a zip file
  

  at ~/.poetry/lib/poetry/utils/env.py:1075 in _run
      1071│                 output = subprocess.check_output(
      1072│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1073│                 )
      1074│         except CalledProcessError as e:
    → 1075│             raise EnvCommandError(e, input=input_)
      1076│ 
      1077│         return decode(output)
      1078│ 
      1079│     def execute(self, bin, *args, **kwargs):


Failed to add packages, reverting the pyproject.toml file to its original content.

It is weird that PyQt5 installed perfectly with Poetry 1.1.6 without any error in my case.

@mkniewallner mkniewallner added status/duplicate Duplicate issues and removed status/triage This issue needs to be triaged labels May 29, 2022
@mkniewallner
Copy link
Member

Same issue as #2674, so closing this one.

@mkniewallner mkniewallner closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

3 participants