ModuleNotFoundError: No module named 'distutils' in Python 3.12.1 when installing oci-cli

485 views Asked by At

I try to install oci-cli using this reference https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#InstallingCLI__windows in Python 3.12.1, I get this error

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'distutils'
Traceback (most recent call last):
  File "C:\Users\badia\AppData\Local\Temp\tmpC9A9.tmp", line 722, in <module>
    main()
  File "C:\Users\badia\AppData\Local\Temp\tmpC9A9.tmp", line 686, 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 "C:\Users\badia\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\badia\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Users\\badia\\lib\\oracle-cli\\Scripts\\python', '-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())']' returned non-zero exit status 1.

From what I search this library is deprecated for this Python version, do you guys have any suggestion to solve this?

Installing oci-cli in Python 3.12.1 but get error message like I provided.

0

There are 0 answers