hildogjr / KiCost

Build cost spreadsheet for a KiCad project.
MIT License
503 stars 98 forks source link

kicost 0.1.43 requires wxpython #322

Closed nickoe closed 5 years ago

nickoe commented 5 years ago

Issue / Problem report

Whenever I invoke kicost I will get

$ kicost --help
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/kicost/kicost_gui.py", line 31, in <module>
    import wx # wxWidgets for Python.
ModuleNotFoundError: No module named 'wx'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/kicost", line 11, in <module>
    load_entry_point('kicost==0.1.43', 'console_scripts', 'kicost')()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2332, in load
    return self.resolve()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2338, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.7/site-packages/kicost/__main__.py", line 37, in <module>
    from .kicost_gui import * # User guide.
  File "/usr/lib/python3.7/site-packages/kicost/kicost_gui.py", line 33, in <module>
    raise ImportError('wxPython package not recognised.')
ImportError: wxPython package not recognised.

even though I have wxpython-gtk2 installed on archlinux from AUR.

I also tried master as of https://github.com/xesscorp/KiCost/commeit/96be627ad5616126a6db45280eb6190c8cf55bfc, but it failed as well. The fork could not join.

I only have the wx module for python2, but when I run with python2 I get: SyntaxError: Non-ASCII character '\xc3' in file /usr/lib/python2.7/site-packages/kicost/distributors/rs/rs.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Doubts

Feature / Enhancement request

I would like to see a switch to disable the GUI, or make it ignore the GUI if not available.

hildogjr commented 5 years ago

Which version are you using? 0.1.43? Second the history this was fix on 0.1.44

hildogjr commented 5 years ago

See #321 for you future installation.

nickoe commented 5 years ago

I was running 0.1.43. Sorry, I did not see that there was a newer verison as there are no tags or releases on this repo and I normally don't use pip.

I did pip2 install kicost --user and now it starts a gui. But I still do not see any option to run "headless".

nickoe commented 5 years ago

Ok, it looks like it does not start the GUI when I provide the commandline args. Thank you. I guess we should consider this a PEBCAK.