skip to Main Content

This is my first question in stackoverflow.

I’m currently using Ubuntu 18.04 to build Chrome V8.

I need Python 3.8 and Python 2.7 versions, but the latter is already installed on Ubuntu, so I don’t need it. But Ubuntu 18.04 LTS is installed with Python 3.6 by default, which causes problems during the V8 build process. (ninja related issues)

Therefore, to use Python 3.8, we installed Anaconda and ran the command below to configure the virtual environment.

conda create –name v8 python=2.7

If I create an environment with Anaconda(2021.04), I thought Python 3’s version would stay at 3.8 which is the Python version of Anaconda, but it ran 3.6, which is the Python 3 version of the existing Ubuntu.

For your information, I also tried the update-alternates command, but the operating system itself is not working, so I would appreciate it if you could tell me how to resolve the issue of this method.

How do I fix this so I can use Python 3.8 and Python 2.7 versions at the same time?

or

Can I change link python command to python2.7(System default) on my anaconda base environment?

2

Answers


  1. Chosen as BEST ANSWER

    I solved this issue!

    Add this line at the end of file.

    alias python=/usr/bin/python2.7
    

    then you can use python2.7 (default) and python 3.8(anaconda3)!


  2. Welcome to Stack Overflow!

    Python 2.x has been deprecated since ~2008, with no security updates since 2020. Are you sure you need it? It would probably be better to simply make the small changes to whatever script you are running to make it compatible with the latest.

    Anyway, with conda you can make multiple isolated environments running different versions of python like this:

    conda create --name v27 python=2.7
    conda create --name v38 python=3.8
    conda activate v27
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search