SlideShare une entreprise Scribd logo
1  sur  39
附錄一: Anaconda 3.x 安裝
Python的懶人包--Anaconda
Anaconda is a free and open source distribution of
the Python and R programming languages for data
science and machine learning related applications
Jupyter notebook
Anaconda & Jupyter notebook
Anaconda
• 提供了套件管理功能,解決python安裝套件
常失敗的問題
• 提供類似virtualenv的功能, 解決多版本
python並存、切換的問題
Jupyter notebook
• Web版本的python IDE
• Anaconda 已附帶Jupyter notebook
Anaconda 3.x 安裝
至 https://www.anaconda.com/download/
下載目前最新版之Anaconda (Python 3.x version )
Anaconda 3 安裝
下載完成後,雙點 Anaconda3 安裝程式開始進行安裝
點選「Next >」
Anaconda 3 安裝
點選「I Agree」
Anaconda 3 安裝
選擇安裝對象後點選點選「Next >」
Anaconda 3 安裝
確認安裝路徑後點選點選「Next >」
Anaconda 3 安裝
確認進階選項後點選「Install」
Anaconda 3 安裝
Anaconda3 正在安裝中,請稍後……
Anaconda 3 安裝
點選「Next >」
Anaconda 3 安裝
把 Learn more 選項勾銷,點選「Finish」完成安裝
進入python原生的Interpreter
鍵入“python” 進入原生的interactive
environment
鍵入“exit()”或 Ctrl-Z 進開
進入ipython Interpreter
鍵入“ipython” 進入
鍵入“exit()”或 Ctrl-D 進開
在ipython下,可以用? 快速查詢物件或函式
ipython 的?及??
Anaconda Jupyter Notebookotebook
啓動Jupyter Notebook
至[開始]->[所有程式] 找到並點選 “Jupyter Notebook “,
Localhost Jupyter Server 隨即啟動
或者 在 [Anaconda Prompt ] 下鍵入 “jupyter notebook” 啓動jupyter notebook
登入Jupyter Server
接著用Browser 連入 “localhost:8888”
尚未啓動密碼,但也可以用token登入
Token? (見下頁)
如何取得token?
在Jupyter Notebook 輸入
jupyter notebook list
成功登入jupyter !
寫第一個python程式
Step1: 新增python3 檔案
寫第一個python程式 (cont.)
Step2: 鍵入 print("I love python")
Ctrl+Enter執行該cell
可以另存程式檔 xxx.ipynb
Code cells
更多關於Jupyter Notebook 的使用
http://nbviewer.jupyter.org/github/ipython/ipython/blob/3.x/examples/Notebo
ok/Index.ipynb
http://jupyter-notebook.readthedocs.io/en/stable/public_server.html
建置一個public jupyter notebook
預設的jupyter notebok 啓動只能由Localhost 連入
1.) 產生一個 notebook configuration file
在[Anaconda Prompt ]執行 jupyter notebook --generate-config
 將產生設定檔於 ~/.jupyter/jupyter_notebook_config.py
2.) 改成任意IP均可連入
修改jupyter_notebook_config.py ,找到
#c.NotebookApp.ip = ‘localhost'
改成
c.NotebookApp.ip = ‘0.0.0.0’
c.NotebookApp.port = 8888
3.) Use password instead of the login
token
設定密碼: jupyter notebook password
再次啓動Jppyter notebook , 此時已改成用密碼登入
Juypter notebook 其他參數
#Specify what command to use to invoke a web
browser when opening the notebook.
c.NotebookApp.browser=
## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir=
'C:/Users/Joseph/Documents/python_example'
Windows Anaconda 預設登入目錄
在jupyter notebook
圖示下按右鍵內容
改成你想要的目錄位置
%USERPROFILE%  C:UsersJosephpythoncodetrunk
Anaconda 套件管理與建立虛擬環境
conda
conda 是 Anaconda 下用於套件管理和環境管理
的工具,功能上類似 pip + vitualenv
在[Anaconda Prompt] 下執行conda命令
套件管理
conda –h # 顯示help
conda install <package>
conda update <package>
conda update --all
conda remove <package>
conda list #列出已安裝的套件
conda search <package> #會列出cloud有找到的套件
#Additional channel to search for packages.
conda install –c <channel> <package>
升級conda : conda update conda
升級anaconda: conda update anaconda
和別人共用環境設定
• conda env export > environment.yaml
• conda env update –f =/path/to/xxx.yaml
https://conda.io/docs/user-guide/tasks/index.html
Example
會列出cloud有找到opencv套件的站台
conda search opencv
安裝來自menpo 站台的opencv
conda install -c menpo opencv
進入 ipython
import cv2
用Anaconda Navigator建立虛擬環境
建立虛擬環境
#建立名為python36的virtualenv, 且使用python
3.6 的版本
conda create –n python36 python=3.6
conda env list #列出所有virtualenv
activate python36 #windows
source activate python36 #Linux
python –V #檢查是否為3.6
deactivate
conda remove –n python36 --all
Example
conda info –e
顯示 目前所有env及目前在那一個env
執行 active python2.7 進入名為python2.7的env
用Anaconda Navigator 進行套件安裝
附錄二: Virtualenv
virtualenv
virtualenv is a tool to create isolated
Python environments.
Virtualenv 可以隔離函數庫需求不同的專
案,讓它們不會互相影響
pip install virtualenv
Create a directory to use for the
virtualenv:
• mkdir test-venv
• virtualenv ./test-venv
38
• activate the virtualenv:
• source ./xxx-venv/bin/activate
• you can deactivate it afterwards, by
simply running deactivate
39

Contenu connexe

Tendances

X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewMoriyoshi Koizumi
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介艾鍗科技
 
Processor Specifications
Processor SpecificationsProcessor Specifications
Processor SpecificationsAli Usman
 
How to hack wireless internet connections using aircrack-ng
How to hack wireless internet connections using aircrack-ngHow to hack wireless internet connections using aircrack-ng
How to hack wireless internet connections using aircrack-ngOpen Knowledge Nepal
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
移植FreeRTOS 之嵌入式軟體研究與開發
移植FreeRTOS 之嵌入式軟體研究與開發移植FreeRTOS 之嵌入式軟體研究與開發
移植FreeRTOS 之嵌入式軟體研究與開發艾鍗科技
 
Intelligent IoT Gateway on OpenWrt
Intelligent IoT Gateway on OpenWrtIntelligent IoT Gateway on OpenWrt
Intelligent IoT Gateway on OpenWrtTieto Corporation
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...linuxlab_conf
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)Kentaro Ebisawa
 
P4によるデータプレーンプログラミングとユースケースのご紹介
P4によるデータプレーンプログラミングとユースケースのご紹介P4によるデータプレーンプログラミングとユースケースのご紹介
P4によるデータプレーンプログラミングとユースケースのご紹介Kumapone
 
tcpdumpとtcpreplayとtcprewriteと他。
tcpdumpとtcpreplayとtcprewriteと他。tcpdumpとtcpreplayとtcprewriteと他。
tcpdumpとtcpreplayとtcprewriteと他。(^-^) togakushi
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition 艾鍗科技
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtAnne Nicolas
 
[CB19] Attacking DRM subsystem to gain kernel privilege on Chromebooks by Di ...
[CB19] Attacking DRM subsystem to gain kernel privilege on Chromebooks by Di ...[CB19] Attacking DRM subsystem to gain kernel privilege on Chromebooks by Di ...
[CB19] Attacking DRM subsystem to gain kernel privilege on Chromebooks by Di ...CODE BLUE
 
RENAT - ネットワーク検証自動化
RENAT - ネットワーク検証自動化RENAT - ネットワーク検証自動化
RENAT - ネットワーク検証自動化HuuBachNguyen
 
Linux Kernel Exploitation
Linux Kernel ExploitationLinux Kernel Exploitation
Linux Kernel ExploitationScio Security
 
Wireshark入門(4)
Wireshark入門(4)Wireshark入門(4)
Wireshark入門(4)彰 村地
 
Raspberry Pi 智慧門鈴系統
Raspberry Pi 智慧門鈴系統Raspberry Pi 智慧門鈴系統
Raspberry Pi 智慧門鈴系統艾鍗科技
 
Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2 「エッジAIモダン計測制御の世界」オ...
Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2  「エッジAIモダン計測制御の世界」オ...Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2  「エッジAIモダン計測制御の世界」オ...
Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2 「エッジAIモダン計測制御の世界」オ...Mr. Vengineer
 
Systemtap
SystemtapSystemtap
SystemtapFeng Yu
 

Tendances (20)

X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural Overview
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介
 
Processor Specifications
Processor SpecificationsProcessor Specifications
Processor Specifications
 
How to hack wireless internet connections using aircrack-ng
How to hack wireless internet connections using aircrack-ngHow to hack wireless internet connections using aircrack-ng
How to hack wireless internet connections using aircrack-ng
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
移植FreeRTOS 之嵌入式軟體研究與開發
移植FreeRTOS 之嵌入式軟體研究與開發移植FreeRTOS 之嵌入式軟體研究與開發
移植FreeRTOS 之嵌入式軟體研究與開發
 
Intelligent IoT Gateway on OpenWrt
Intelligent IoT Gateway on OpenWrtIntelligent IoT Gateway on OpenWrt
Intelligent IoT Gateway on OpenWrt
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)
 
P4によるデータプレーンプログラミングとユースケースのご紹介
P4によるデータプレーンプログラミングとユースケースのご紹介P4によるデータプレーンプログラミングとユースケースのご紹介
P4によるデータプレーンプログラミングとユースケースのご紹介
 
tcpdumpとtcpreplayとtcprewriteと他。
tcpdumpとtcpreplayとtcprewriteと他。tcpdumpとtcpreplayとtcprewriteと他。
tcpdumpとtcpreplayとtcprewriteと他。
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
 
[CB19] Attacking DRM subsystem to gain kernel privilege on Chromebooks by Di ...
[CB19] Attacking DRM subsystem to gain kernel privilege on Chromebooks by Di ...[CB19] Attacking DRM subsystem to gain kernel privilege on Chromebooks by Di ...
[CB19] Attacking DRM subsystem to gain kernel privilege on Chromebooks by Di ...
 
RENAT - ネットワーク検証自動化
RENAT - ネットワーク検証自動化RENAT - ネットワーク検証自動化
RENAT - ネットワーク検証自動化
 
Linux Kernel Exploitation
Linux Kernel ExploitationLinux Kernel Exploitation
Linux Kernel Exploitation
 
Wireshark入門(4)
Wireshark入門(4)Wireshark入門(4)
Wireshark入門(4)
 
Raspberry Pi 智慧門鈴系統
Raspberry Pi 智慧門鈴系統Raspberry Pi 智慧門鈴系統
Raspberry Pi 智慧門鈴系統
 
Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2 「エッジAIモダン計測制御の世界」オ...
Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2  「エッジAIモダン計測制御の世界」オ...Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2  「エッジAIモダン計測制御の世界」オ...
Google Edge TPUで TensorFlow Liteを使った時に 何をやっているのかを妄想してみる 2 「エッジAIモダン計測制御の世界」オ...
 
Systemtap
SystemtapSystemtap
Systemtap
 

Similaire à 附錄--Anaconda installation

[精彩回顾]Linux新手教程
[精彩回顾]Linux新手教程[精彩回顾]Linux新手教程
[精彩回顾]Linux新手教程NJU OPEN
 
人工智慧01_安裝機器學習開發環境
人工智慧01_安裝機器學習開發環境人工智慧01_安裝機器學習開發環境
人工智慧01_安裝機器學習開發環境Fuzhou University
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Yiwei Ma
 
如何讓Keras能在R語言中運作_安裝教學
如何讓Keras能在R語言中運作_安裝教學如何讓Keras能在R語言中運作_安裝教學
如何讓Keras能在R語言中運作_安裝教學Yen-Ting Su
 
unix toolbox 中文版
unix toolbox 中文版unix toolbox 中文版
unix toolbox 中文版Jie Bao
 
01 jupyter 第一課
01 jupyter 第一課01 jupyter 第一課
01 jupyter 第一課Yen-lung Tsai
 
Configuration tutorial for pytorch environment under windows.pdf
Configuration tutorial for pytorch environment under windows.pdfConfiguration tutorial for pytorch environment under windows.pdf
Configuration tutorial for pytorch environment under windows.pdfshuaihaohan135
 
Docker tutorial
Docker tutorialDocker tutorial
Docker tutorialazole Lai
 
docker intro
docker introdocker intro
docker introkoji lin
 
自动化运维管理
自动化运维管理自动化运维管理
自动化运维管理frankwsj
 
Android系统移植技术详解
Android系统移植技术详解Android系统移植技术详解
Android系统移植技术详解zzc89522
 
GNU Autoconf / Automake #1
GNU Autoconf / Automake #1GNU Autoconf / Automake #1
GNU Autoconf / Automake #1imacat .
 
Unixtoolbox zh cn
Unixtoolbox zh cnUnixtoolbox zh cn
Unixtoolbox zh cnxdboy2006
 
Docker容器微服務 x WorkShop
Docker容器微服務 x WorkShopDocker容器微服務 x WorkShop
Docker容器微服務 x WorkShopPhilip Zheng
 
Clojure cnclojure-meetup
Clojure cnclojure-meetupClojure cnclojure-meetup
Clojure cnclojure-meetupsunng87
 

Similaire à 附錄--Anaconda installation (20)

[精彩回顾]Linux新手教程
[精彩回顾]Linux新手教程[精彩回顾]Linux新手教程
[精彩回顾]Linux新手教程
 
人工智慧01_安裝機器學習開發環境
人工智慧01_安裝機器學習開發環境人工智慧01_安裝機器學習開發環境
人工智慧01_安裝機器學習開發環境
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)
 
如何讓Keras能在R語言中運作_安裝教學
如何讓Keras能在R語言中運作_安裝教學如何讓Keras能在R語言中運作_安裝教學
如何讓Keras能在R語言中運作_安裝教學
 
unix toolbox 中文版
unix toolbox 中文版unix toolbox 中文版
unix toolbox 中文版
 
建置Python開發環境
建置Python開發環境建置Python開發環境
建置Python開發環境
 
01 jupyter 第一課
01 jupyter 第一課01 jupyter 第一課
01 jupyter 第一課
 
Configuration tutorial for pytorch environment under windows.pdf
Configuration tutorial for pytorch environment under windows.pdfConfiguration tutorial for pytorch environment under windows.pdf
Configuration tutorial for pytorch environment under windows.pdf
 
Docker tutorial
Docker tutorialDocker tutorial
Docker tutorial
 
docker intro
docker introdocker intro
docker intro
 
自动化运维管理
自动化运维管理自动化运维管理
自动化运维管理
 
LinuxGuide4F2E
LinuxGuide4F2ELinuxGuide4F2E
LinuxGuide4F2E
 
Linuxguide4f2e
Linuxguide4f2eLinuxguide4f2e
Linuxguide4f2e
 
Android系统移植技术详解
Android系统移植技术详解Android系统移植技术详解
Android系统移植技术详解
 
GNU Autoconf / Automake #1
GNU Autoconf / Automake #1GNU Autoconf / Automake #1
GNU Autoconf / Automake #1
 
Dl
DlDl
Dl
 
Unixtoolbox zh cn
Unixtoolbox zh cnUnixtoolbox zh cn
Unixtoolbox zh cn
 
unixtoolbox_zh_CN
unixtoolbox_zh_CNunixtoolbox_zh_CN
unixtoolbox_zh_CN
 
Docker容器微服務 x WorkShop
Docker容器微服務 x WorkShopDocker容器微服務 x WorkShop
Docker容器微服務 x WorkShop
 
Clojure cnclojure-meetup
Clojure cnclojure-meetupClojure cnclojure-meetup
Clojure cnclojure-meetup
 

Plus de 艾鍗科技

Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab艾鍗科技
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用艾鍗科技
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation艾鍗科技
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 艾鍗科技
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進艾鍗科技
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆艾鍗科技
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作艾鍗科技
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車艾鍗科技
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作 艾鍗科技
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車 艾鍗科技
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning艾鍗科技
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統艾鍗科技
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home艾鍗科技
 
雲端智能盆栽
雲端智能盆栽雲端智能盆栽
雲端智能盆栽艾鍗科技
 
How to -- Goolge colab
How to -- Goolge colabHow to -- Goolge colab
How to -- Goolge colab艾鍗科技
 

Plus de 艾鍗科技 (20)

Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation
 
Openvino ncs2
Openvino ncs2Openvino ncs2
Openvino ncs2
 
Step motor
Step motorStep motor
Step motor
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron)
 
3. data features
3. data features3. data features
3. data features
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home
 
智能健身
智能健身智能健身
智能健身
 
雲端智能盆栽
雲端智能盆栽雲端智能盆栽
雲端智能盆栽
 
How to -- Goolge colab
How to -- Goolge colabHow to -- Goolge colab
How to -- Goolge colab
 

附錄--Anaconda installation