Install virtualenv is failing on updated Ubuntu 22.04
michael-newsrx opened this issue · comments
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
> Task :checkPython FAILED
Using python 3.10.4 from /usr (python3)
Using pip 22.1.2 from /home/michael/.local/lib/python3.10/site-packages/pip (python 3.10)
Using virtualenv /home/michael/.local/lib/python3.10/site-packages/virtualenv.py:24: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
import distutils.spawn
/home/michael/.local/lib/python3.10/site-packages/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
import distutils.sysconfig
16.7.9 (in '.gradle/python')
[python] python3 -m virtualenv .gradle/python
/home/michael/.local/lib/python3.10/site-packages/virtualenv.py:24: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
import distutils.spawn
/home/michael/.local/lib/python3.10/site-packages/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
import distutils.sysconfig
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/michael/.local/lib/python3.10/site-packages/virtualenv.py", line 2634, in <module>
main()
File "/home/michael/.local/lib/python3.10/site-packages/virtualenv.py", line 860, in main
create_environment(
File "/home/michael/.local/lib/python3.10/site-packages/virtualenv.py", line 1162, in create_environment
install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
File "/home/michael/.local/lib/python3.10/site-packages/virtualenv.py", line 1721, in install_python
fix_local_scheme(home_dir, symlink)
File "/home/michael/.local/lib/python3.10/site-packages/virtualenv.py", line 1807, in fix_local_scheme
if sysconfig._get_default_scheme() == "posix_local":
AttributeError: module 'sysconfig' has no attribute '_get_default_scheme'. Did you mean: 'get_default_scheme'?
Using base prefix '/usr'
New python executable in /home/michael/git/Documentation/.gradle/python/bin/python3
Also creating executable in /home/michael/git/Documentation/.gradle/python/bin/python
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkPython'.
> Python call failed: python3 -m virtualenv .gradle/python
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
1 actionable task: 1 executed
Your virtualenv version (16.7.9) is not compatible with python 3.10.
Either use 16.7.11 or switch to the recent 20.14.1.
You'll have to manually upgrade virtualenv:
pip install --upgrade virtualenv==16.7.11
Omit version to simply install the latest (20.14.1)
Note that plugin will install virtualenv only if no virtualenv is installed (but not the latest version 20.14.1, see python.virtualenvVersion
option)
Thanks. Clearing out the .local folder of all python libs also helped.