推薦:使用 Anaconda 工具搭建並管理 Python 環境

https://www.anaconda.com/distribution/#download-section  官網下載地址html

https://mirror.tuna.tsinghua.edu.cn/help/anaconda/     Anaconda 鏡像使用幫助python

 

https://repo.anaconda.com/archive/Anaconda2-2019.07-Windows-x86_64.exe  64bit  for Python 2.7 version,使用IDM下載便可sql

https://repo.anaconda.com/archive/Anaconda3-2019.07-Windows-x86_64.exe   64bit  for  Python 3.7 version ,使用IDM下載便可json

 

Anaconda3 沒有開始菜單,參考:https://www.jianshu.com/p/beb59ca2b46e   ?工具


 

 

 1、安裝 Anaconda2-2019.07-Windows-x86_64.exe優化

 

 

 

 開始菜單ui

 

 

安裝完成。已經自動安裝了python 2.7.16this

 

能夠將 「D:\PythonWork\Anaconda2」 目錄添加到path中spa

 

2、再安裝 python 3.7.net

開始菜單 --> 啓動 Anaconda Prompt (Anaconda2)

運行命令:conda create -n python37 python=3.7

安裝過程:

(base) C:\Users\zh>conda create -n python37 python=3.7
Collecting package metadata (current_repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.7.10
  latest version: 4.7.11

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: D:\PythonWork\Anaconda2\envs\python37

  added / updated specs:
    - python=3.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2019.5.15  |                1         127 KB
    certifi-2019.6.16          |           py37_1         152 KB
    openssl-1.1.1d             |       he774522_0         5.7 MB
    pip-19.2.2                 |           py37_0         1.7 MB
    python-3.7.4               |       h5263a28_0        14.7 MB
    setuptools-41.0.1          |           py37_0         520 KB
    sqlite-3.29.0              |       he774522_0         624 KB
    vc-14.1                    |       h0510ff6_4           6 KB
    vs2015_runtime-14.16.27012 |       hf0eaf9b_0         1.1 MB
    wheel-0.33.4               |           py37_0          57 KB
    wincertstore-0.2           |           py37_0          14 KB
    ------------------------------------------------------------
                                           Total:        24.7 MB

The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/win-64::ca-certificates-2019.5.15-1
  certifi            pkgs/main/win-64::certifi-2019.6.16-py37_1
  openssl            pkgs/main/win-64::openssl-1.1.1d-he774522_0
  pip                pkgs/main/win-64::pip-19.2.2-py37_0
  python             pkgs/main/win-64::python-3.7.4-h5263a28_0
  setuptools         pkgs/main/win-64::setuptools-41.0.1-py37_0
  sqlite             pkgs/main/win-64::sqlite-3.29.0-he774522_0
  vc                 pkgs/main/win-64::vc-14.1-h0510ff6_4
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.16.27012-hf0eaf9b_0
  wheel              pkgs/main/win-64::wheel-0.33.4-py37_0
  wincertstore       pkgs/main/win-64::wincertstore-0.2-py37_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
vc-14.1              | 6 KB      | #################################### | 100%
wincertstore-0.2     | 14 KB     | #################################### | 100%
pip-19.2.2           | 1.7 MB    | #################################### | 100%
vs2015_runtime-14.16 | 1.1 MB    | #################################### | 100%
openssl-1.1.1d       | 5.7 MB    | #################################### | 100%
setuptools-41.0.1    | 520 KB    | #################################### | 100%
certifi-2019.6.16    | 152 KB    | #################################### | 100%
ca-certificates-2019 | 127 KB    | #################################### | 100%
wheel-0.33.4         | 57 KB     | #################################### | 100%
sqlite-3.29.0        | 624 KB    | #################################### | 100%
python-3.7.4         | 14.7 MB   | #################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use # # $ conda activate python37 # # To deactivate an active environment, use # # $ conda deactivate


(base) C:\Users\zh>

 

 

切到python 3.7 命令:conda activate python37

回到python 2.7 命令:conda deactivate

 

3、打開 python IDE工具

開始菜單 ---啓動---> Spyder (Anaconda2)

 

主界面,默認使用的是 Python 2.7:

 

如何讓 Spyder 使用Python 3.7 ?

方法步驟:

開始菜單 --> 啓動 Anaconda Prompt (Anaconda2) ,而後依次運行以下命令:

1. 切到python 3.7 命令:conda activate python37

2. 安裝spyder命令: conda install spyder

3. 命令行啓動:spyder

固然,開始菜單也能夠啓動 ---> Spyder (python37)

 

通過上述步驟後,若想使用python 2.7,則啓動「Spyder (Anaconda2)」 ;若想使用python 3.x,則啓動「Spyder (python37)」 便可,完美!

 

 

參考:

https://www.cnblogs.com/liruihuan/p/9101613.html   Anaconda 安裝和使用

https://blog.csdn.net/wz947324/article/details/80228679   Anaconda不一樣版本python環境的安裝及切換

http://www.javashuo.com/article/p-pdswzvtn-hc.html  python神器——Anaconda的安裝與優化配置

相關文章
相關標籤/搜索