显示python对应版本的指令是什么_更改命令提示符的默认python版本

On my machine I have python3.4 and a recently downloaded python3.6 installed, I would like to set python3.6 as my default python used in command prompt.

I have removed the python34 path variable but my when I access python through the command prompt it still defaults to opening python3.4. I saw this question about access the non default python but that was for specific files.

Since posting the question:

I have also removed python34 from the system path variables.

Typing where python in command prompt returns this:

C:\>where python

C:\Python34\python.exe

C:\Python36\python.exe

Typing echo %PATH% returns

C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Python34;;C:\WINDOWS\System32\OpenSSH\;C:\Python36\Scripts\;C:\Python36\;C:\Users\ME\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;

The accepted answer on the proposed duplicate states it is possible but you shouldn't do it, and doesn't give details on how to do it.

解决方案

After doing a restart of my machine after deleting python34 from my system path variables as @Talha Junaid mentioned in the comments, my python now defaults to python3.6 when accessed through command prompt, windows must load all the path variables on startup and hold them in memory until a restart occurs.

Steps for anyone else starting the process.

Windows 10

Type "System" into the search bar to go to system settings in the control panel (Control Panel\All Control Panel Items\System)

Click "Advanced System Settings" -> 2Environment Variables2

For User Variables:

Highlight the row for "Path" by clicking on it and then click the "Edit" button

Highlight by clicking the version of python you want to remove from your environment variables and then click the "Delete" button.

Repeat steps 3 and 4 for System Environment Variables.

Close all the windows by clicking the "Ok" buttons

Restart your machine

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值