Python 【 Tools 】Ubuntu 安裝 Pygame 內容 學習目標 前置準備作業 安裝 Pygame 學習目標 在 Ubuntu 安裝 Pygame 前置準備作業 已安裝 Python 3 Ubuntu 安裝教學 https://learningsky.io/python-development-on-ubuntu-with-pyenv-virtualenv/ 安裝 Pygame Step 1. 更新軟體的最新資訊及列表 請在終端機中輸入下方指令sudo apt-get update Step 2. 安裝相依套件 請在終端機中輸入下方指令 sudo
Ubuntu 【 Solutions 】解決 Python3: ModuleNotFoundError: No module named '_ctypes' 問題 Python3 安裝套件出現下方訊息 from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes' make: *** [Makefile:1132: install] Error 1 解決方案 Ubuntu 環境 請在終端機輸入下方指令sudo apt-get install libffi-dev GitHub ArcherHuang @ GitHub List of
Python 【 Python 】將 bytes 與 float 間互轉 內容 學習目標 前置準備作業 bytes 轉 float float 轉 bytes 學習目標 bytes 反轉 ascii 解碼 進制轉換 bytes 與 float 間互轉 前置準備作業 已安裝 Python 3 bytes 轉換 Step 1. 將 bytes 與 float 間互轉 轉換程式如下
Python 【 Python 】將 bytes 反轉後再轉成 10 進位 內容 學習目標 前置準備作業 bytes 轉換 學習目標 bytes 反轉 ascii 解碼 進制轉換 前置準備作業 已安裝 Python 3 bytes 轉換 Step 1. 將 bytes 反轉後再轉成 10 進位 轉換程式如下 說明 第 1 行:引用 binascii 套件 第
Python 【 Python 】使用 requests 時發生 InsecureRequestWarning: Unverified HTTPS request is being made 問題 透過 Python 呼叫帶有 https 的 API 時發生以下錯誤 : InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) 解決方案
Azure 【 AIoT 】於 Azure VM 中使用單一 NVIDIA GPU 訓練影像 內容 學習目標 前置準備作業 訓練花朵影像 驗證訓練完成的模型 前置準備作業 已建立 Azure GPU Ubuntu VM 且已安裝 Cuda 請參考 https://learningsky.io/install-nvidia-cuda-10-0-on-ubuntu-16-04 訓練花朵影像 Step 1. 遠端登入的 Azure VM macOS 參考文件 - 透過瀏覽器開啟下方網址 https://learningsky.io/cloud-remote-login-azure-vm-ubuntu-macos/ Windows
Front-End & Back-End 【 Python 】透過 flask 中的 send_file 傳送影像 內容 學習目標 前置準備作業 建立發送影像 API 建立取得影像程式 學習目標 透過 Python flask 傳送影像到 client 端 前置準備作業 已安裝 Python 已安裝 IDE 本範例使用 Visual Studio Code Server 端 Step 1. 安裝 flask 套件 請在終端機 ( macOS ) 或 PowerShell
Front-End & Back-End 【 Python 】利用 .env 與環境變數隱藏敏感資訊 內容 學習目標 前置準備作業 專案初始化 dotenv 套件應用 學習目標 透過 dotenv 套件來隱藏敏感資訊 前置準備作業 環境已安裝 Python、 環境已安裝pip 環境已安裝 Visual Studio Code 專案初始化 Step 1. 建立專案目錄 建立名為 dotenvSample 的專案目錄 本範例在桌面建立 dotenvSample 的專案目錄 dotenvSample 專案目錄內尚未有檔案 Step 2. 開啟專案目錄
Python 【 Solutions 】解決 _tkinter.TclError: no display name and no $DISPLAY environment variable 問題 因在終端下無 GUI 所造成的問題 解決方案 將 matplotlib 設置為不使用 Xwindowsecho "backend : Agg" > ~/.config/matplotlib/matplotlibrc GitHub ArcherHuang @ GitHub List of blogs https://oranwind.org/author/archer/ https://learningsky.io/author/archer/
Python 【 Solutions 】解決 ImportError cv2.cpython-37m-arm-linux-gnueabihf.so 問題 在 Raspberry Pi 4 中 import cv2 發生下方錯誤訊息 解決方案 因新版的 openCV 不支援 Raspberry Pi,故請在終端機輸入下方指令pip3 install opencv-python==3.4.6.27 GitHub ArcherHuang @ GitHub List of blogs https://oranwind.org/author/archer/
Python 【 Python 】呼叫 API 出現 SSL: CERTIFICATE_VERIFY_FAILED 錯誤 問題 透過 Python 呼叫 API 時發生 SSL: CERTIFICATE_VERIFY_FAILED 錯誤 解決方案 在 requests 呼叫處加上 verify=False 原始程式 修改後程式 GitHub ArcherHuang @ GitHub List of blogs https://oranwind.org/author/archer/ https://learningsky.io/
Tools 【 Solutions 】IPython 與 Python 版本不一致造成啟動錯誤 問題 當啟動 IPython 時出現下方錯誤訊息 原因為安装的 Python 版本是 3.5,但 IPython 版本卻是 7.10+,兩邊的版本不符合,所以降低 IPython 版本即可解決。 解決方案 移除已安裝的 IPython 輸入以下指令進行解除安裝 pip3 uninstall -y ipython 安裝 7.9.0 版本的 IPython 輸入以下指令進行安裝
Programming language 【 Version Management 】Python 版本管理與虛擬環境 ( Ubuntu ) 內容 學習目標 前置準備作業 程式與軟體 pyenv 安裝與使用 學習目標 在 Ubuntu 建立安裝多個 Python 版本並進行版本管理 Python 虛擬環境建立與使用 前置準備作業 Ubuntu 16.04 程式與軟體 pyenv pyenv-virtualenv Python pyenv 安裝與使用 Step 1. 登入到 Ubuntu Step 2. 軟體更新 請在 終端機
Programming language 【 Integrate 】使用 child_process 整合 Node.js 與 Python 內容 學習目標 前置準備作業 程式與軟體 Node.js 程式 Python 程式 測試 學習目標 透過 Node.js 的 Express 建立一支 API,並經由 child_process 來呼叫 Python 程式,並將結果再回傳給用戶端 前置準備作業 IDE Visual Studio Code 已安裝 Node.js
Programming language 【 Integrate 】使用 python-shell 整合 Node.js 與 Python 內容 學習目標 前置準備作業 程式與軟體 Node.js 程式 Python 程式 測試 學習目標 透過 Node.js 的 Express 建立一支 API,並經由 python-shell 來呼叫 Python 程式,並將結果再回傳給用戶端 前置準備作業 IDE Visual Studio Code 已安裝 Node.js 已安裝
Programming language 【 Version Management 】Python 版本管理與虛擬環境 ( macOS ) 內容 學習目標 前置準備作業 程式與軟體 pyenv 安裝與使用 學習目標 在 macOS 建立安裝多個 Python 版本並進行版本管理 Python 虛擬環境建立與使用 程式與軟體 Homebrew pyenv pyenv-virtualenv Python pyenv 安裝與使用 Step 1. 安裝 Homebrew 請在 終端機 執行下方指令/usr/bin/ruby -e "