安裝Anaconda使用TensoFlow

1、下載anaconda 運行安裝  https://www.anaconda.com/download-success

2、anacanda powershell prompt 
conda create -n itmamba_anaconda1 python=3.7 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda清華源鏡像 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

3、添加清華源到conda的配置
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
使用conda的深度學習和機器學習相關包,添加conda-forge通道
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
確認是否已經配置成功,可以使用以下命令查看當前配置
conda config --show

4、查看是否環境創建成功
conda info -e
切換環境
conda activate itmamba_anaconda1

5、安裝包
pip install tensorflow -i https://pypi.doubanio.com/simple

pip install matplotlib -i https://pypi.doubanio.com/simple

pip install numpy -i https://pypi.doubanio.com/simple

pip install pandas -i https://pypi.doubanio.com/simple

pip install jupyter -i https://pypi.doubanio.com/simple

6、打開jupyter notebook
jupyter notebook

7、配置路徑
jupyter notebook --generate-config

Writing default config to: C:\Users\35181\.jupyter\jupyter_notebook_config.py

python -m pip install jupyter_contrib_nbextensions

jupyter contrib nbextension install --user --skip-running-check

pip install autopep8 -i https://pypi.doubanio.com/simple

jupyter notebook --generate-config

如果報錯 安裝較低版本的python包

pip install -i https://pypi.doubanio.com/simple pyqt5==5.12.3

pip install -i https://pypi.doubanio.com/simple pyqtwebegine==5.12.1

打開juoyter_notebook_config.py
修改c.NotebookApp.notebook_dir = 'D:\\PYTHON\\PROJECT\\jupyter_notebook_project'

8、安裝autopep8
pip install autopep8 -i https://pypi.doubanio.com/simple

9、安裝提示
python -m pip install jupyter_contrib_nbextensions -i https://pypi.doubanio.com/simple
jupyter contrib nbextension install --user --skip-running-check

10、安裝主題
pip install jupyterthemes -i https://pypi.doubanio.com/simple
jt -t grade3 -f consolamono -fs 140 -altp -tfs 13 -nfs 115 -ofs 14 -cellw 80% -T

11、打開jupyter notebook
首頁-Nvextensions 配置勾選Table of contents、contrib_nbextensions_help_item、jupyter-js-widgets/extension、Nbextensions dashboard tab、Autopep8、CodeFontSize、Hinterland、Nbextensions edit menu item、spellchecker、Toggle all line numbers

新建python文件 new Python3(ipykernel)

import tensorflow as tf
import numpy as np
import pandas as pd
print("hello world")
print(tf.__version__)
print(np.__version__)
print(pd.__version__)
運行結果:
hello world
2.11.0
1.21.6
1.3.5
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章