簡體   English   中英

在Python 3.5和3.6之間切換

[英]Switch between Python 3.5 and 3.6

我在計算機上安裝了最新的Python 3.6 ,但要下載張量流,我也在同一台計算機上安裝了3.5版本。 在cmd提示符下檢查python版本時,顯示3.6.3。

C:\\ Users \\ aakash.sharma01> py Python 3.6.3 | Anaconda,Inc. | (默認值,2017年10月15日,03:27:45)[win32上的[MSC v.1900 64位(AMD64)]]

如何將默認版本更改為3.5?

另外,當我檢查Anaconda的安裝路徑時,它顯示了python36 dll的信息。 路徑:

(C:\Users\aakash.sharma01\AppData\Local\Continuum\anaconda3)

不確定是否與此問題有關?

您可以安裝tensorflow conda為Python 3.6:

conda install -c conda-forge tensorflow 

當前,這將為您提供1.3.0版本。

除了使用水蟒之外,還建議使用其他方法。

如果您的操作系統是Ubuntu,請使用update-alternatives

$ sudo update-alternatives --list python3
update-alternatives: error: no alternatives for python

>> Add python version

$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.4 1
update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python3 (python3) in auto mode
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 2
update-alternatives: using /usr/bin/python3.5 to provide /usr/bin/python3 (python3) in auto mode

>> Config python version

$ sudo update-alternatives --config python3
There are 2 choices for the alternative python3 (providing /usr/bin/python3).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /usr/bin/python3.5   2         auto mode
  1            /usr/bin/python3.4   1         manual mode
  2            /usr/bin/python3.5   2         manual mode

Press enter to keep the current choice[*], or type selection number:

然后,您可以在兩個版本的python之間進行選擇。

要更改anaconda的默認python解釋器,請使用conda install python=3.5

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM