JarrettR / Stretch

KiCad to SVG and then back again
GNU General Public License v3.0
129 stars 11 forks source link

Plugin doesn't load in KiCad 8.0 `No module named 'bs4'` #36

Open aocole opened 5 months ago

aocole commented 5 months ago

Hello. Thanks for this plugin. I installed v1.3 via the plugin manager but the plugin doesn't load. The "plugin errors" dialog under preferences shows me the following:

  File "/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/aocole/Documents/KiCad/8.0/3rdparty/plugins/com_github_jarrettr_stretch/__init__.py", line 3, in <module>
    from .kiplug.svg_writer import SvgWrite
  File "/Users/aocole/Documents/KiCad/8.0/3rdparty/plugins/com_github_jarrettr_stretch/kiplug/svg_writer.py", line 4, in <module>
    from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
JarrettR commented 5 months ago

Thanks for the report.

To fix that, you'll need to BS4. So you'll have to python -m pip install bs4 with whatever version of Python is being run by KiCad.

I'm not sure where that is on Mac - Windows it's at C:\Program Files\KiCad\8.0\bin\python.exe and Linux uses the system Python.

aocole commented 5 months ago

Thanks - in my case on mac:

cd /Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/bin
./pip3 install bs4