cooked / kimotor

KiCad plugin for the design of parametric PCB motors
54 stars 12 forks source link

Plugin doesn't load, missing IU_PER_MM constant #60

Closed marcsekz closed 5 months ago

marcsekz commented 7 months ago

I installed the plugin from the plugin and content manager, but it does not load. This is the backtrace I get:

>>> import pcbnew
>>> print pcbnew.GetWizardsBackTrace()
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pcbnew.py", line 4448, in LoadPluginModule
    mod = importlib.import_module( ModuleName )
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/marcsekz/.local/share/kicad/7.0/3rdparty/plugins/com_github_cooked_kimotor/__init__.py", line 2, in <module>
    from .kimotor_action import KiMotor
  File "/home/marcsekz/.local/share/kicad/7.0/3rdparty/plugins/com_github_cooked_kimotor/kimotor_action.py", line 39, in <module>
    class KiMotorDialog ( kimotor_gui.KiMotorGUI ):
  File "/home/marcsekz/.local/share/kicad/7.0/3rdparty/plugins/com_github_cooked_kimotor/kimotor_action.py", line 43, in KiMotorDialog
    SCALE = pcbnew.IU_PER_MM
AttributeError: module 'pcbnew' has no attribute 'IU_PER_MM'

KiCAD version info:

Application: KiCad PCB Editor x86_64 on x86_64

Version: 7.0.10-7.0.10~ubuntu22.04.1, release build

Libraries: wxWidgets 3.2.1 FreeType 2.11.1 HarfBuzz 6.0.0 FontConfig 2.13.1 libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16

Platform: Ubuntu 22.04.3 LTS, 64 bit, Little endian, wxGTK, ubuntu, wayland

Build Info: Date: Dec 31 2023 13:35:31 wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24 Boost: 1.74.0 OCC: 7.5.2 Curl: 7.88.1 ngspice: 38 Compiler: GCC 11.4.0 with C++ ABI 1016

Build settings: KICAD_SPICE=ON

cooked commented 7 months ago

Hi @marcsekz , sorry for the inconvenience. Please have a look at the installation section of the README file and give it a try to one of the two "manual installation" methods. The plugin version in the package manager has now fallen behind, while the code from the repo contains the fixes you need.