Home > Software design >  How can I fix the problem of python2.7 instead of pytho
How can I fix the problem of python2.7 instead of pytho

Time:10-04

i installed python3.10.7 a couple of days ago. I have never installed python2, but when I wanted to install pip it gave me that error that I have python2.7 Then I see the version of python in cmd and it gives me python2.7. Ihave never install that and I do not want version2.7 at all. what should I do

CodePudding user response:

What I get from your question is that you have checked the version of python using

python --version

If you are using Linux it is possible that Python was pre-installed in your system. But now if you have installed python 3.xx run the command(s) with python3 not just python. Or simply uninstall the old python as @jps has mentioned.

But if you don't want to take the risk of uninstalling the old version. Then just use the word python3.

And in that case, check the version by,

python3 --version

It should give you the latest python3 version that you have just installed. Now use whatever command you want using python3.

CodePudding user response:

use python3 python-script.py

instead of previous

python python-script.py

  • Related