it_management icon indicating copy to clipboard operation
it_management copied to clipboard

Python 3.11 compatibility issue fixed

Open HUMENTH opened this issue 1 year ago • 4 comments

Commented "parse_requirements" in setup.py file to fix the compatibility issue with latest pip.

HUMENTH avatar Aug 17 '23 18:08 HUMENTH

@beingeek please have a look over this PR and check if necessary. Thank you.

wojosc avatar Aug 21 '23 11:08 wojosc

Commented "parse_requirements" in setup.py file to fix the compatibility issue with latest pip.

Thank you for your PR. We will have a look into it and get back to you asap!

wojosc avatar Aug 21 '23 11:08 wojosc

Hi @HUMENTH Please mention which version of pip you are facing this issue, or better mention all configuration like bench, frappe and erpnext version along with error message

beingeek avatar Aug 21 '23 18:08 beingeek

Hello @beingeek Sorry for wrongly mentioned "Pip". It's python 3.11 😅 App is installing properly with python 3.10 and pip 23.2.1, but throwing error with python 3.11 and pip 23.2.1.

bench 5.17.0 erpnext 14.35.2 frappe 14.45.0

Error:

Getting it_management
$ git clone https://github.com/phamos-eu/it_management --branch version-14 --depth 1 --origin upstream
Cloning into 'it_management'...
remote: Enumerating objects: 320, done.
remote: Counting objects: 100% (320/320), done.
remote: Compressing objects: 100% (189/189), done.
remote: Total 320 (delta 189), reused 208 (delta 125), pack-reused 0
Receiving objects: 100% (320/320), 151.52 KiB | 7.97 MiB/s, done.
Resolving deltas: 100% (189/189), done.
Ignoring dependencies of https://github.com/phamos-eu/it_management. To install dependencies use --resolve-deps
Installing it_management
$ /home/erpnext/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/erpnext/frappe-bench/apps/it_management
  error: subprocess-exited-with-error

  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      Traceback (most recent call last):
        File "<string>", line 6, in <module>
      ModuleNotFoundError: No module named 'pip'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/erpnext/frappe-bench/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/erpnext/frappe-bench/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/erpnext/frappe-bench/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 132, in get_requires_for_build_editable
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-7t1wtr0j/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 468, in get_requires_for_build_editable
          return self.get_requires_for_build_wheel(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-7t1wtr0j/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-7t1wtr0j/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-7t1wtr0j/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-7t1wtr0j/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 8, in <module>
      ModuleNotFoundError: No module named 'pip'
      [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 editable 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.
ERROR: /home/erpnext/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/erpnext/frappe-bench/apps/it_management
subprocess.CalledProcessError: Command '/home/erpnext/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/erpnext/frappe-bench/apps/it_management ' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/dist-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/usr/local/lib/python3.10/dist-packages/bench/commands/make.py", line 159, in get_app
    get_app(
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 444, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 242, in install
    install_app(
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 573, in install_app
    bench.run(
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/__init__.py", line 158, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: /home/erpnext/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/erpnext/frappe-bench/apps/it_management

HUMENTH avatar Aug 22 '23 05:08 HUMENTH