接下來介紹spyder和pycharm的相關編譯環境搭建
第一步:官網:https://www.anaconda.com/download 去下載,選擇Python3.6 version。
第二步:安裝Anaconda
安裝過程中,注意下圖溝第一個一定要打勾,第二個可以選擇不勾,其他next就可以了
安裝完成後,進行測試。如出現下圖就證明配置完成。
打開Anaconda prompt,輸入清華倉庫鏡像,可以讓更新更快
配置如下
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
創建名爲TensorFlow的conda環境
輸入
conda create -n tensorflow pip python=3.6
完成後輸入
activate tensorflow
安裝完成後,想要spyder和ipython中使用TensorFlow,操作如下
打開Abaconda Navigator
安裝spyder。
完成後,Spyder(TensorFlow)就出現了
打開它,進行測試。
TensorFlow的安裝配置就完成了。
安裝pycharm的話,就不用安裝spyder
pycharm安裝如下:
可以從官網https://www.jetbrains.com/pycharm/download/下載PyCharm安裝程序。
安裝完成後
選擇註冊
https://blog.csdn.net/u014044812/article/details/78727496
註冊完之後pycharm,導入環境
選擇Settings...,找到project Interpreter
找到你anaconda下的python.exe點擊OK,然後apply就OK了
更新指令
conda install --channel https://conda.anaconda.org/anaconda tensorflow
conda update python
conda update conda
pip指定鏡像源安裝
pip國內的一些鏡像源
阿里雲 http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/
臨時指定:
可以在使用pip的時候在後面加上-i參數
pip install TensorFlow -i https://pypi.tuna.tsinghua.edu.cn/simple
這樣就可以在pip下載安裝TensorFlow的使用 清華大學的鏡像源,安裝其他模塊的時候同樣使用
永久指定:
1、WIN+R,輸入 %APPDATA% ,創建一個文件夾命名pip。
2、進入pip文件夾,新建文本文件,修改名字及後綴爲 pip.ini
3、打開pip.ini,輸入內容
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
保存,然後隨便安裝一個模塊試下吧。
有什麼問題可以一起探討