skip to Main Content

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


  1. Just do these steps

    sudo apt update
    sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
    
    wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
    sudo tar xzf Python-3.7.4.tgz
    
    cd Python-3.7.4
    
    sudo ./configure
    sudo make
    sudo make install
    
    Login or Signup to reply.
  2. 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:

      sudo apt-get update
      sudo apt-get install software-properties-common
      
    • 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:

      sudo add-apt-repository ppa:deadsnakes/ppa
      sudo apt-get update
      
    • Now that the Deadsnakes PPA is added, you can proceed to install Python 3.7:

      sudo apt-get install python3.7
      
    • To confirm that Python 3.7 has been successfully installed, run the following command:

      python3.7 -V
      

    For more: https://www.osetc.com/en/how-to-install-the-latest-python-3-7-on-ubuntu-16-04-or-18-04.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search