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

Add support for Python 3.12, install.sh fails (distutils module removed in Python 3.12 -- Ubuntu 24.04 users affected) #850

Open
damntourists opened this issue Oct 2, 2024 · 5 comments

Comments

@damntourists
Copy link

Previously, this issue was marked as completed without a resolution #778, however users have been responding saying that it's not corrected. I did not see any open issues regarding this (please correct me if I've missed it) so I'm resubmitting a request to have this resolved.

This is still an issue for Ubuntu 24.04 users, since it comes with Python 3.12.3 as the default python version which does not include distutils. The CLI installer marks Python 3.12.3 as OK when installing then breaks since distutils was deprecated and not included with this version of python.

Could we at least get the installer updated to recognize that Python 3.12 is not supported for the short term? Ideally we'd have a fallback built into the installer if a version higher than 3.11 is detected.

> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:        24.04
Codename:       noble
[ ... ]
-- Verifying Python version.
-- Python version 3.12.3 okay.
[ ... ]
Installing collected packages: wcwidth, pytz, circuitbreaker, types-python-dateutil, terminaltables, six, PyYAML, pycparser, prompt-toolkit, jmespath, click, certifi, python-dateutil, cffi, cryptography, arrow, pyOpenSSL, oci, oci_cli
Successfully installed PyYAML-6.0.1 arrow-1.3.0 certifi-2024.8.30 cffi-1.17.1 circuitbreaker-2.0.0 click-8.0.4 cryptography-42.0.8 jmespath-0.10.0 oci-2.135.1 oci_cli-3.48.2 prompt-toolkit-3.0.43 pyOpenSSL-24.2.1 pycparser-2.22 python-dateutil-2.9.0.post0 pytz-2024.2 six-1.16.0 terminaltables-3.1.10 types-python-dateutil-2.9.0.20240906 wcwidth-0.2.13
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'distutils'
Traceback (most recent call last):
  File "/tmp/oci_cli_install_tmp_HxSR", line 722, in <module>
    main()
  File "/tmp/oci_cli_install_tmp_HxSR", line 705, in main
    venv_site_packages_directory = subprocess.check_output([venv_python_executable, '-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())']).strip()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/brett/lib/oracle-cli/bin/python', '-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())']' returned non-zero exit status 1.
@karthik-k-kamath
Copy link
Member

Hi @damntourists , the OCI CLI does not yet support Python 3.12, so I suggest using Python 3.11 to resolve this issue, till CLI comes out with support for Python 3.12.

@karthik-k-kamath
Copy link
Member

FYI, we plan to support Python 3.12 in 1-2 months time

@damntourists
Copy link
Author

Right, that is the issue I'm reporting. The CLI installer is incorrectly showing Python 3.12 as compatible and proceeds to try to install anyway. A fix would be to set a maximum compatible version instead of saying any version greater than or equal to X.

I'm curious why this ticket is closed when the issue is not resolved? You say it comes in 1-2mo time, however now the public has to take your word for it and a record of this issue can easily fall into the void. I had trouble finding information about this issue because the other ticket I mentioned was closed as completed.

@karthik-k-kamath
Copy link
Member

Thanks Brett for sharing more on why the incompatibility is not obvious when using the installer.
I will reopen this till we release out the v3.12 compatibility support by Dec 2024

@damntourists
Copy link
Author

Thanks @karthik-k-kamath!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants