sachin-sankar / swiftshadow

Free IP Proxy rotator library for python
https://sachin-sankar.github.io/swiftshadow/
GNU General Public License v3.0
72 stars 5 forks source link

bug: failed instalation using poetry on ubuntu 22 #19

Closed vikyw89 closed 4 months ago

vikyw89 commented 5 months ago

(src-py3.11) vikyw@vikyw-X456UR:~/Desktop/chat-based-financial-gpt/server$ poetry add swiftshadow
Using version ^1.0.0 for swiftshadow

Updating dependencies
Resolving dependencies... (4.4s)

Package operations: 1 install, 0 updates, 0 removals

  • Installing swiftshadow (1.0.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel

  Traceback (most recent call last):
    File "/home/vikyw/.local/pipx/venvs/poetry/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/vikyw/.local/pipx/venvs/poetry/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/vikyw/.local/pipx/venvs/poetry/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmp94df84ec/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/tmp94df84ec/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "/tmp/tmp94df84ec/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 480, in run_setup
      super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
    File "/tmp/tmp94df84ec/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 18, in <module>
    File "<string>", line 1, in <module>
  ModuleNotFoundError: No module named 'requests'

  at ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with swiftshadow (1.0.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "swiftshadow (==1.0.0)"'.```
sachin-sankar commented 5 months ago

Working on a patch

tb102122 commented 4 months ago

@sachin-sankar we are facing the same issue using pip install -r requirements.txt

Collecting swiftshadow (from -r requirements.txt (line 15))
  Downloading swiftshadow-1.0.0.tar.gz (21 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "....\Temp\pip-install-t7anad75\swiftshadow_8c929ff8793e445e889698d3c71dfdaa\setup.py", line 18, in <module>
          exec(fp.read(), VERSION)
        File "<string>", line 1, in <module>
      ModuleNotFoundError: No module named 'requests'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
sachin-sankar commented 4 months ago

Fixing the patch seems hard as the code was written years ago therefore I am rewriting the entire thing ground up and should be ready in a week.