如何设置Jupiter Notebook服务器并从任何地方访问它(Windows 10)
新程序員指南: (New Programmer’s Guide:)
介紹: (Introduction:)
I want to work from my laptop and have my desktop do all of the heavy lifting.
我想用筆記本電腦工作,讓臺式機完成所有繁重的工作。
It might not seem like it, but that simple request can actually be pretty hard to implement as a new programmer.
看起來似乎不是這樣,但是作為一個新程序員,實際上很難實現簡單的請求。
This article is an attempt to change that and make it easy for everyone.
本文試圖改變這一點并使所有人都容易使用。
It offers a long-term solution to using desktop resources from your laptop:
它提供了從筆記本電腦使用桌面資源的長期解決方案:
- CPU Clock Speed CPU時鐘速度
- CPU Cores CPU核心
- RAM 內存
- GPU 顯卡
- HDD/SSD/NVMe 硬盤/ SSD / NVMe
目錄: (Table of Contents:)
- Set Up the Remote Desktop on the PC - 在PC上設置遠程桌面 
- Set Up the Remote Desktop on the Laptop - 在筆記本電腦上設置遠程桌面 
- Set Up Python on the PC - 在PC上設置Python 
- Set up OpenSSL on the PC - 在PC上設置OpenSSL 
- Set Up Jupyter on the PC - 在PC上設置Jupyter 
- Set Up the Text Editor on the PC - 在PC上設置文本編輯器 
- Edit the PATH Environment Variable on the PC - 在PC上編輯PATH環境變量 
- Create an SSL Certificate on the PC - 在PC上創建SSL證書 
- Set Up a Configuration File on the PC - 在PC上設置配置文件 
- Set Up the Server Password on the PC - 在PC上設置服務器密碼 
- Set Up the Server on the PC - 在PC上設置服務器 
- Access the Server at Home on the Laptop - 在筆記本電腦上在家訪問服務器 
- Open the Port on the PC - 在PC上打開端口 
- Verify the Port is Working on the PC - 驗證端口在PC上是否正常工作 
- Set Up Port Forwarding on the PC - 在PC上設置端口轉發 
- Access the Server From Anywhere on the Laptop - 從筆記本電腦上的任何地方訪問服務器 
- Set Up a Static IP Address on the PC - 在PC上設置靜態IP地址 
在PC上設置遠程桌面: (Set Up the Remote Desktop on the PC:)
The remote desktop is only used to set up and troubleshoot the PC.
遠程桌面僅用于設置PC并對其進行故障排除。
First, we’ll create a TeamViewer account:
首先,我們將創建一個TeamViewer帳戶:
Visit the official website
訪問官方網站
Next, we’ll install the application:
接下來,我們將安裝該應用程序:
Visit the download page on the official website
訪問官方網站上的下載頁面
Next, we’ll sign into the application:
接下來,我們將登錄到該應用程序:
Next, we’ll authorize the computer:
接下來,我們將授權計算機:
Lastly, we’ll get the computer :
最后,我們將獲得計算機:
在筆記本電腦上設置遠程桌面: (Set Up the Remote Desktop on the Laptop:)
This allows the laptop to set up and troubleshoot the server on the PC.
這使筆記本電腦可以在PC上設置服務器并進行故障排除。
First, we’ll install the application:
首先,我們將安裝該應用程序:
Visit the official website
訪問官方網站
Next, we’ll sign into the application:
接下來,我們將登錄到該應用程序:
Next, we’ll authorize the computer:
接下來,我們將授權計算機:
Lastly, we’ll set up the application:
最后,我們將設置應用程序:
Remember:
記得:
- Both computers must be turned on and awake to establish a connection. 必須打開兩臺計算機,然后將它們喚醒以建立連接。
- The connection will automatically terminate after the window is closed. 關閉窗口后,連接將自動終止。
在PC上設置Python: (Set Up Python on the PC:)
This Python version was the latest stable version at the time.
這個Python版本是當時的最新穩定版本。
First, we’ll download Python:
首先,我們將下載Python:
Visit the download page on the official website
訪問官方網站上的下載頁面
Click the “Executable Installer” that matches your system type
單擊與您的系統類型匹配的“可執行安裝程序”
Reference:
參考:
- “Windows x86–64 executable installer” refers to Windows 64-bit “ Windows x86–64可執行安裝程序”是指Windows 64位
- “Windows x86 executable installer” refers to Windows 32-bit “ Windows x86可執行安裝程序”是指Windows 32位
Next, we’ll install Python:
接下來,我們將安裝Python:
在PC上設置OpenSSL: (Set up OpenSSL on the PC:)
OpenSSL comes preinstalled with Git on Windows 10.
Windows 10上的Git預先安裝了OpenSSL。
在PC上設置Jupyter: (Set Up Jupyter on the PC:)
First, we’ll open Command Prompt:
首先,我們將打開命令提示符:
Next, we’ll install Jupyter:
接下來,我們將安裝Jupyter:
Next, we’ll install the Jupyter extension:
接下來,我們將安裝Jupyter擴展:
This extension allows Jupyter Notebook to access the GPU in the desktop.
此擴展允許Jupyter Notebook訪問桌面中的GPU。
python -m pip install jupyter_http_over_ws在PC上設置文本編輯器: (Set Up the Text Editor on the PC:)
This step only applies to computers that don’t have a text editor installed.
此步驟僅適用于未安裝文本編輯器的計算機。
In this section, we’ll install Sublime:
在本節中,我們將安裝Sublime:
Visit the official website
訪問官方網站
在PC上編輯PATH環境變量: (Edit the PATH Environment Variable on the PC:)
The PATH environment variable is a list of directories that contain commonly used executable files. The Command Prompt uses that list to run programs that execute commands.
PATH環境變量是包含常用可執行文件的目錄的列表。 命令提示符使用該列表來運行執行命令的程序。
First, we’ll open the PATH environment variable:
首先,我們將打開PATH環境變量:
Next, we’ll add the path that contains the executable Python modules:
接下來,我們將添加包含可執行Python模塊的路徑:
Lastly, we’ll save the changes we’ve made to the PATH environment variable:
最后,我們將保存對PATH環境變量所做的更改:
The “OK” button must be clicked to save the PATH environment variable.
必須單擊“確定”按鈕以保存PATH環境變量。
在PC上創建SSL證書: (Create an SSL Certificate on the PC:)
SSL stands for Secure Socket Layer. It’s a standard security method that adds a layer of protection to the data being transferred over the server. It works by establishing an encrypted link between the server and the remote browser.
SSL代表安全套接字層。 這是一種標準的安全方法,為通過服務器傳輸的數據增加了一層保護。 它通過在服務器和遠程瀏覽器之間建立加密鏈接來工作。
First, we’ll open Command Prompt:
首先,我們將打開命令提示符:
Next, we’ll use the cd command to navigate to the Python directory:
接下來,我們將使用cd命令導航到Python目錄:
Next, we’ll create the SSL certificate:
接下來,我們將創建SSL證書:
This command is copied directly from the documentation.
該命令直接從文檔中復制。
openssl req -config “C:\Program Files\Git\usr\ssl\openssl.cnf” -x509 -nodes -days 365 -newkey rsa:1024 -keyout mykey.key -out mycert.pem在PC上設置配置文件: (Set Up a Configuration File on the PC:)
First, we’ll create the configuration file for Jupyter Notebook:
首先,我們將為Jupyter Notebook創建配置文件 :
This creates the configuration file in the “.jupyter” directory.
這將在“ .jupyter”目錄中創建配置文件。
jupyter notebook --generate-configNext, we’ll create the an empty JSON file on the Windows PC:
接下來,我們將在Windows PC上創建一個空的JSON文件:
Next, we’ll open Run:
接下來,我們將打開“運行”:
Next, we’ll open the .jupyter directory:
接下來,我們將打開.jupyter目錄:
Next, we’ll open the configuration file:
接下來,我們將打開配置文件:
Next, we’ll get the Windows account name:
接下來,我們將獲得Windows帳戶名:
Lastly, we’ll add the server configurations:
最后,我們將添加服務器配置:
Reference:
參考:
- These configuration options are copied from the documentation - 這些配置選項是從文檔中復制的 
- The file paths in the JSON file must use double backslashes JSON文件中的文件路徑必須使用雙反斜杠
在PC上設置服務器密碼: (Set Up the Server Password on the PC:)
In this section, we’ll create a password for the Jupyter Notebook server:
在本節中,我們將為Jupyter Notebook服務器創建一個密碼:
This adds the hashed password to the JSON configuration file.
這會將哈希密碼添加到JSON配置文件中。
jupyter notebook password在PC上設置服務器: (Set Up the Server on the PC:)
First, we’ll open Task Scheduler:
首先,我們將打開任務計劃程序:
Next, we’ll create a task that starts a program when Windows starts:
接下來,我們將創建一個在Windows啟動時啟動程序的任務:
Next, we’ll specify which program to start:
接下來,我們將指定要啟動的程序:
Lastly, we’ll specify when to start the program:
最后,我們將指定何時啟動程序:
在筆記本電腦上在家訪問服務器: (Access the Server at Home on the Laptop:)
The server should be accessible from the local network after restarting.
重新啟動后,應該可以從本地網絡訪問服務器。
First, we’ll restart the Windows PC:
首先,我們將重新啟動Windows PC:
Next, we’ll verify that the server is working:
接下來,我們將驗證服務器是否正常運行:
Visit the server IP address
訪問服務器IP地址
Next, we’ll sign into Jupyter Notebook:
接下來,我們將登錄Jupyter Notebook:
Lastly, we’ll bookmark the server IP address:
最后,我們將服務器IP地址添加為書簽:
The browser will display a warning, but the documentation suggests it’s ok.
瀏覽器將顯示警告,但文檔顯示可以。
Private Jupyter Notebook Server打開PC上的端口: (Open the Port on the PC:)
First, we’ll open the “Advanced Settings” in the Windows firewall:
首先,我們將在Windows防火墻中打開“高級設置”:
Next, we’ll add a new inbound rule:
接下來,我們將添加一個新的入站規則:
驗證端口在PC上是否正常工作: (Verify the Port is Working on the PC:)
The port should be accessible from remote networks after it’s opened:
打開端口后,應該可以從遠程網絡訪問該端口:
In this section, we’ll verify that the port is working:
在本節中,我們將驗證端口是否正常工作:
Visit a port checking website
訪問端口檢查網站
在PC上設置端口轉發: (Set Up Port Forwarding on the PC:)
This video has a simple explanation of LAN, WAN, and Port Forwarding.
該視頻簡單介紹了LAN,WAN和端口轉發。
First, we’ll get the local IP address of the Windows PC:
首先,我們將獲得Windows PC的本地IP地址:
Next, we’ll sign into the local router:
接下來,我們將登錄到本地路由器:
Visit the router IP address
訪問路由器IP地址
Lastly, we’ll set up the port forwarding:
最后,我們將設置端口轉發:
The specific steps for each router will likely vary, but it should be similar.
每個路由器的具體步驟可能會有所不同,但是應該相似。
從筆記本電腦上的任何位置訪問服務器: (Access the Server from Anywhere on the Laptop:)
First, we’ll get the public IP address on the Windows PC:
首先,我們將在Windows PC上獲得公共IP地址:
Google the public IP address
Google的公共IP地址
Next, we’ll construct the server IP address:
接下來,我們將構建服務器IP地址:
Next, we’ll visit the server IP address on the laptop:
接下來,我們將在筆記本電腦上訪問服務器IP地址:
Next, we’ll sign into Jupyter Notebook:
接下來,我們將登錄Jupyter Notebook:
Lastly, we’ll bookmark the server IP address:
最后,我們將服務器IP地址添加為書簽:
Remember:
記得:
- The server isn’t accessible on the local IP address from a remote network 無法通過遠程網絡在本地IP地址上訪問服務器
- The browser can’t connect to the server without the HTTPS protocol 沒有HTTPS協議,瀏覽器無法連接到服務器
- The browser can’t connect to the server without the port number 沒有端口號,瀏覽器無法連接到服務器
- A remote network refers to any network that isn’t the local network 遠程網絡是指不是本地網絡的任何網絡
在PC上設置靜態IP地址: (Set Up a Static IP Address on the PC:)
By default, most internet service providers assign a dynamic IP address to devices. This means the IP address changes regularly. While that’s good for security, it’s bad for remote connections.
默認情況下,大多數Internet服務提供商將動態IP地址分配給設備。 這意味著IP地址會定期更改。 雖然這對安全性有好處,但對遠程連接卻不利。
This article has a good introduction to “Dynamic” and “Static” IP addresses.
本文對“動態”和“靜態” IP地址進行了很好的介紹。
First, we’ll set get the network details:
首先,我們將獲取網絡詳細信息:
Next, we’ll write down the following details:
接下來,我們將寫下以下詳細信息:
- IPv4 address IPv4地址
- Subnet Mask 子網掩碼
- Default Gateway 默認網關
- Preferred DNS server (top) 首選DNS服務器(頂部)
- Alternate DNS server (bottom) 備用DNS服務器(底部)
Next, we’ll open the network adapter properties:
接下來,我們將打開網絡適配器屬性:
Next, we’ll open the Internet Protocol Version 4 properties:
接下來,我們將打開“ Internet協議版本4”屬性:
致謝: (Acknowledgements:)
TaxiCat helped troubleshoot the firewall, router, and port forwarding.
TaxiCat幫助解決了防火墻,路由器和端口轉發問題。
This article helped suggest TeamViewer.
本文有助于建議TeamViewer。
This article helped schedule the server.
本文有助于安排服務器。
This article helped set up the static IP address.
本文有助于設置靜態IP地址。
翻譯自: https://medium.com/swlh/how-to-set-up-a-jupiter-notebook-server-and-access-it-from-a-local-or-remote-network-on-windows-d335c5ba490d
總結
以上是生活随笔為你收集整理的如何设置Jupiter Notebook服务器并从任何地方访问它(Windows 10)的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: ps怎么把图片拼接起来
- 下一篇: 双帆电瓶是杂牌子吗
