Pyslvs 使用手冊

  • Home
    • Site Map
    • reveal
    • blog
  • 簡介
    • 機構與機器
    • Pyslvs 介面
      • Mechanism
      • Inputs
      • Synthesis
  • 操作
    • 模擬操作
      • 曲柄滑塊
      • 四連桿
    • 尺寸合成操作
    • 構造合成操作
    • 由現有設計進行尺寸合成
  • 下載
  • 分析
    • 三角形表示式
  • 範例
    • 模擬範例
      • Quick return mechanism
      • Watt six-bar linkage
      • Stephenson six-bar linkage
      • Klann linkage
    • 尺寸合成範例
    • 結構合成範例
    • 產品設計範例
  • Python 教學
    • 控制流程
    • 簽章
    • 複製與參照
    • 物件導向
    • 類型註解
  • 開發
    • Windows 開發
      • 環境修正
      • PyInstaller 對 Windows 的支援
    • Ubuntu 開發
      • AppImage 包裝
    • Mac OS X 開發
      • PyInstaller 對 Mac OS X 的支援
    • 參與協同
      • 註解規則
      • 命名規則
      • 類型註解規則
    • Kmol-editor
  • 參考
    • Misc
Windows 開發 << Previous Next >> PyInstaller 對 Windows 的支援

環境修正

從 p37 標準版升級能夠以 Msys2 編譯 Pyslvs-PyQt5

pip install pyqtchart lark-parser networkx ezdxf peewee openpyxl psutil pyinstaller cffi pyyaml

cygwinccompiler.py 修改

套用編譯器設定的補釘,其位於 Pyslvs 專案的 platform 目錄中。

patch p37\lib\distutils\cygwinccompiler.py platform\patch.diff

patch.diff 內容:

--- cygwinccompiler.py
+++ cygwinccompiler.py
@@ -82,7 +82,21 @@ def get_msvcr():
         elif msc_ver == '1600':
             # VS2010 / MSVC 10.0
             return ['msvcr100']
+        elif msc_ver == '1700':
+            # Visual Studio 2012 / Visual C++ 11.0
+            return ['msvcr110']
+        elif msc_ver == '1800':
+            # Visual Studio 2013 / Visual C++ 12.0
+            return ['msvcr120']
+        elif msc_ver == '1900':
+            # Visual Studio 2015 / Visual C++ 14.0
+            # "msvcr140.dll no longer exists" http://blogs.msdn.com/b/vcblog/archive/2014/06/03/visual-studio-14-ctp.aspx
+            return ['vcruntime140']
+        elif msc_ver == '1910':
+            return ['vcruntime140']
+        elif msc_ver == '1914':
+            return ['vcruntime140']
         else:
             raise ValueError("Unknown MS Compiler version %s " % msc_ver)

增加 distutils.cfg 檔案

在 p37\Lib\distutils 目錄中新增 distutils.cfg

echo [build]>> p37\Lib\distutils\distutils.cfg
echo compiler = mingw32>> p37\Lib\distutils\distutils.cfg

修改 _advapi32.py 檔案

修改 p37\Lib\site-packages\win32ctypes\core\cffi\_advapi32.py

蓋掉第 197 與 199 行

#c_creds.CredentialBlobSize = \

    #ffi.sizeof(blob_data) - ffi.sizeof('wchar_t')

Windows 開發 << Previous Next >> PyInstaller 對 Windows 的支援

Copyright © All rights reserved | This template is made with by Colorlib