Closed bartdorlandt closed 1 year ago
I can't reproduce this problem
It seems when creating this I left out an important detail. I was using poetry to install fortigate-api.
mkdir /tmp/ff
python3.10 -m venv .venv
poetry init
poetry add fortigate-api
output:
Using version ^0.2.6 for fortigate-api
Updating dependencies
Resolving dependencies... (0.6s)
Writing lock file
Package operations: 6 installs, 0 updates, 0 removals
• Installing certifi (2022.6.15)
• Installing charset-normalizer (2.1.1)
• Installing idna (3.3)
• Installing urllib3 (1.26.12)
• Installing requests (2.28.1)
• Installing fortigate-api (0.2.6): Failed
CalledProcessError
Command '['/private/tmp/ff/.venv/bin/python', '/Users/bart/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-22.2.2-py3-none-any.whl/pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/private/tmp/ff/.venv', '--no-deps', '/Users/bart/Library/Caches/pypoetry/artifacts/83/37/8f/35d181b16e27e34c1900d827ecfea7867d3fe0db40ba7bc12b5921af42/fortigate_api-0.2.6.tar.gz']' returned non-zero exit status 1.
at ~/.pyenv/versions/3.10.5/lib/python3.10/subprocess.py:524 in run
520│ # We don't call process.wait() as .__exit__ does that for us.
521│ raise
522│ retcode = process.poll()
523│ if check and retcode:
→ 524│ raise CalledProcessError(retcode, process.args,
525│ output=stdout, stderr=stderr)
526│ return CompletedProcess(process.args, retcode, stdout, stderr)
527│
528│
The following error occurred when trying to handle this error:
EnvCommandError
Command ['/private/tmp/ff/.venv/bin/python', '/Users/bart/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-22.2.2-py3-none-any.whl/pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/private/tmp/ff/.venv', '--no-deps', '/Users/bart/Library/Caches/pypoetry/artifacts/83/37/8f/35d181b16e27e34c1900d827ecfea7867d3fe0db40ba7bc12b5921af42/fortigate_api-0.2.6.tar.gz'] errored with the following return code 1, and output:
Processing /Users/bart/Library/Caches/pypoetry/artifacts/83/37/8f/35d181b16e27e34c1900d827ecfea7867d3fe0db40ba7bc12b5921af42/fortigate_api-0.2.6.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
Traceback (most recent call last):
File "/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/tmpxqohejrd_in_process.py", line 363, in <module>
main()
File "/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/tmpxqohejrd_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/tmpxqohejrd_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/pip-build-env-0pyfyeip/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/private/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/pip-build-env-0pyfyeip/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "/private/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/pip-build-env-0pyfyeip/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 482, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/pip-build-env-0pyfyeip/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 7, in <module>
File "/private/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/pip-req-build-1la2_xk_/fortigate_api/__init__.py", line 3, in <module>
from fortigate_api.fortigate import Fortigate
File "/private/var/folders/4c/xmcy7hkn283bzd0vthnj87mw0000gn/T/pip-req-build-1la2_xk_/fortigate_api/fortigate.py", line 12, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
at ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/utils/env.py:1473 in _run
1469│ output = subprocess.check_output(
1470│ command, stderr=subprocess.STDOUT, env=env, **kwargs
1471│ )
1472│ except CalledProcessError as e:
→ 1473│ raise EnvCommandError(e, input=input_)
1474│
1475│ return decode(output)
1476│
1477│ def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
The following error occurred when trying to handle this error:
PoetryException
Failed to install /Users/bart/Library/Caches/pypoetry/artifacts/83/37/8f/35d181b16e27e34c1900d827ecfea7867d3fe0db40ba7bc12b5921af42/fortigate_api-0.2.6.tar.gz
at ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/utils/pip.py:51 in pip_install
47│
48│ try:
49│ return environment.run_pip(*args)
50│ except EnvCommandError as e:
→ 51│ raise PoetryException(f"Failed to install {path.as_posix()}") from e
52│
(.venv) bart@Barts-MacBook-Pro ff % python3 -V 1 ↵
Python 3.10.6
problem solved in fortigate-api 1.0.1
When installing the fortigate-api using pip, it crashes and fails on 'requests' not being present.
Using a fresh virtualenv the following can be seen. I'm not able to understand yet, why pypi wouldn't honor the "install_requires" argument (or so it seems).
python version: 3.10.5
prior versions don't seem to have this issue.