多个版本的Python如何设置不冲突

    同时装有Python2.7和Python3.5说明.

问题1: 设置右键点击"Edit with IDLE"选项打开的Python版本?

  在运行输入"regedit"进入注册表;

  找到[HKEY_CLASSES_ROOTPython.FileShellEdit with IDLEcommand],可以看到数据已经被修改为2.7版本

  双击"默认",将值修改为 "C:UsersAdministratorAppDataLocalProgramsPythonPython35-32pythonw.exe" "C:UsersAdministratorAppDataLocalProgramsPythonPython35-32Libidlelibidle.pyw" -e "%1"

问题2:如何指定双击打开".py"文件的程序

    在运行输入"regedit"进入注册表;

  找到[HKEY_CLASSES_ROOTPython.FileShellopencommand]

      将值改为"C:UsersAdministratorAppDataLocalProgramsPythonPython35-32py.exe" "%L" %*

      同时修改环境变量Path     C:UsersAdministratorAppDataLocalProgramsPythonPython35-32;C:UsersAdministratorAppDataLocalProgramsPythonPython35-32Scripts

问题3: 在需要使用2.7运行时使用2.7,则通过鼠标右键执行

在运行输入"regedit"进入注册表;

找到[HKEY_CLASSES_ROOTPython.FileShell]项中新建"通过Python2.7运行",在新建项"command" ,设默认值为"C:Python27python.exe" "%1" %*

问题4: 如果系统中同时存在Python3.5和Python2.7时,那么在命令模式下输入 python,默认是执行 python2.7

  注: 输入 quit() 或 exit() 可以退出 Python2.7,如果想进入Python3呢? 只需要输入Python -3 即可.

问题5:pip安装新模块

Python2.7使用的是  pip  模块名

Python3.5使用的是 py -3 -m pip install XXXX命令.

其中 问题4,5未实践,直接拷贝的小甲鱼

本文参考的是: 如何让多个版本的Python和谐共处 http://bbs.fishc.com/thread-58701-1-1.html



----------- 赠人玫瑰,手有余香     如果本文对您有所帮助,动动手指扫一扫哟   么么哒 -----------


未经作者 https://www.cnblogs.com/xin1006/ 梦相随1006 同意,不得擅自转载本文,否则后果自负
原文地址:https://www.cnblogs.com/xin1006/p/5763265.html