天天看點

FlatCAM_beta_8.993的Windows環境搭建及源碼編譯

下載下傳并解壓源碼包FlatCAM_beta_8.993_sources.zip,裡面有requirements.txt檔案。原則上pip install -r requirements.txt這行指令可以安裝全部依賴,但是實踐過程困難重重,本篇博文記錄下來。

開發環境:Windows7 x64+Anaconda3 x64+Python3.8 x64+PyQt5+PyCharm 2019.3

Windows開發環境搭建

https://blog.csdn.net/libaineu2004/article/details/107738347

FlatCAM依賴庫離線安裝

以下涉及的python依賴包無法通過pip線上安裝,隻能下載下傳離線包再安裝。

https://www.lfd.uci.edu/~gohlke/pythonlibs/

(base) C:\Users\firecat>conda activate firecat

(firecat) C:\Users\firecat>pip install Rtree-0.9.4-cp38-cp38-win_amd64.whl

(firecat) C:\Users\firecat>pip install GDAL-3.1.2-cp38-cp38-win_amd64.whl

(firecat) C:\Users\firecat>pip install Shapely-1.7.0-cp38-cp38-win_amd64.whl

(firecat) C:\Users\firecat>pip install rasterio-1.1.5-cp38-cp38-win_amd64.whl

這些檔案中的cp38是指安裝包支援的是Python3.8版本。

Python本地的版本與下載下傳的安裝包的版本要一一比對。否則會報錯:

*.whl is not a supported wheel on this platform

DLL檔案需要拷貝

D:\ProgramData\Anaconda3\envs\firecat\Lib\site-packages\shapely\DLLs\

geos.dll

geos_c.dll

拷貝到

D:\ProgramData\Anaconda3\envs\firecat\Library\bin\

安裝其他依賴庫

(firecat) C:\Users\firecat>pip install -r requirements.txt

FlatCAM程式運作

PyCharm工程-FlatCAM.py-右鍵菜單-運作

運作遇到的問題及解決辦法

問題1:ModuleNotFoundError: No module named 'win32comext'

(firecat) C:\Users\firecat>pip install pywin32

問題2:ImportError: DLL load failed while importing win32api: 找不到指定的子產品。

(firecat) C:\Users\firecat>cd /d D:\ProgramData\Anaconda3\envs\firecat\Scripts

(firecat) C:\Users\firecat>python pywin32_postinstall.py -install

---

FlatCAM是免費和開源的 PCB CAM,采用 Python + PyQt編寫,在大多數平台上穩定運作。FlatCAM 是一種為在數控雕刻機上制造 pcb 的數控工作的程式。它将您的 PCB 工程項目生成的 Gerber 檔案,轉換成數控雕刻機通用的 G-Code 代碼。

http://flatcam.org/

-- 2D Computer-Aided PCB Manufacturing

https://bitbucket.org/jpcgt/flatcam http://flatcam.org/manual/objectreference.html#paint-area https://bitbucket.org/jpcgt/flatcam/src/master/

穩定版源碼下載下傳

https://bitbucket.org/jpcgt/flatcam/src/Beta/

最新版beta源碼下載下傳

https://bitbucket.org/jpcgt/flatcam/downloads/

安裝程式下載下傳