简体   繁体   English

如何从 Python 3.5 升级到 3.6?

[英]How to upgrade from Python 3.5 to 3.6?

My machine runs on Windows and I tried to find out about it but people only talk about mac and brew on other discussions.我的机器在 Windows 上运行,我试图了解它,但人们只在其他讨论中谈论 mac 和brew I want to ask if there is a command line which I need to write which can upgrade the core or I have to download 3.6 package from the official website and then uninstall the 3.5 and then install 3.6 (and I don't want to do that because it sounds mess to me)请问有没有需要写的命令行可以升级内核 还是得去官网下载3.6的包然后卸载3.5再安装3.6(我不想那样做因为这对我来说听起来很混乱)

I have 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)]我有3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)]

Any help?有什么帮助吗?

I think you have to download Python 3.6 package, but no need to uninstall the 3.5 Version (you can have both)我认为你必须下载 Python 3.6 包,但不需要卸载 3.5 版本(你可以同时拥有)

Keep in mind that the custom libraries you where using with python 3.5 have to be installed for 3.6 too, but you can do that with pip easily请记住,您在 python 3.5 中使用的自定义库也必须为 3.6 安装,但您可以使用 pip 轻松完成

Changing the interpreter from pycharm can be achieved when creating a new project:创建新项目时可以实现从pycharm更改解释器:

在此处输入图片说明

or from default settings for an already created project:或从已创建项目的默认设置:

在此处输入图片说明

On Unix it would be fair enough to correct softlinks.在 Unix 上,纠正软链接就足够了。 On Windows as far as I see people resort to playing around with paths.据我所知,在 Windows 上,人们会玩弄路径。 Here is the most detailed answer. 是最详细的答案。

If someone's using MacOS, Linux or WSL then can use asdf .如果有人使用 MacOS、Linux 或 WSL,则可以使用asdf

  1. Clone the asdf repository克隆asdf存储库
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
  1. Edit ~/.bashrc file and add $HOME/.asdf/asdf.sh编辑~/.bashrc文件并添加$HOME/.asdf/asdf.sh

  2. Restart your terminal and you'll be able to use asdf重启你的终端,你就可以使用asdf

  3. In order to add the plugins, in your case Python , you can run this -为了添加插件,在你的情况下Python ,你可以运行这个 -

asdf plugin add python
  1. List all the versions of python -列出所有版本的python -
asdf list all python
  1. Install the version as per your requirement (can install the latest one) -根据您的要求安装版本(可以安装最新版本)-
asdf install python latest
  1. Set the installed version globally , locally (for a particular project) or for this particular shell .全局本地(对于特定项目)或为此特定shell设置已安装的版本。
asdf global python latest

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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