简体   繁体   中英

How to Convert my compiler from python2 to python3

I am trying to convert from. python2 to python3. Using "python --version", I was able to see that my PATH variable points to python2 and not python3 which I also have available on my machine. This become obvious whenever I type in alias python=python3, the result comes up as python 3.9.2 which is the latest version of python I installed recently.

The problem now, and where I have spent hours tryin to figure things out, is how to tell the interpreter to default on the updated version of python (python3) when I am using the IDE to run a program.

Thanks to all for your help.

You should be using virtual environments;)

pip install virtualenv

then make a virtual environment with:

python3 -m venv .env

You could replace .env with whatever name you like. For more information on this, I'd suggest you take a look at the docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM