I tried this approach but got:
add-apt-repository ppa:deadsnakes/ppa
Error processing line 1 of /usr/local/lib/python3.5/dist-packages/distutils-precedence.pth:
Traceback (most recent call last):
File "/usr/lib/python3.5/site.py", line 173, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/_distutils_hack/__init__.py", line 194
f'spec_for_{name}',
^
SyntaxError: invalid syntax
Remainder of file ignored
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.7
E: Couldn't find any package by glob 'python3.7'
E: Couldn't find any package by regex 'python3.7'
It looks like some package is running a Python3.6 script in Python3.5. Is this related to the problem?
How do I install Python3.7?
2
Answers
Just do these steps
To install Python 3.7 on Ubuntu using the Deadsnakes PPA, follow these steps:
If you don’t have
software-properties-common
installed on your system, you can install it with the following command:The Deadsnakes PPA provides various versions of Python that are not available in the default repositories. You can add it to your system using these commands:
Now that the Deadsnakes PPA is added, you can proceed to install Python 3.7:
To confirm that Python 3.7 has been successfully installed, run the following command:
For more: https://www.osetc.com/en/how-to-install-the-latest-python-3-7-on-ubuntu-16-04-or-18-04.html