Cannot Get KiCost to Run

I would really like to be able to use KiCost, and have spent four hours today trying to get it to work, to no avail. I’m trying to install it on a Windows 10 machine. I have an xml BOM file from KiCad 5.x. I followed the installation instructions at kicost.readthedocs.io carefully. I did easy_install kicost, which generated a number of warnings and syntax errors.

C:\Users\Julia>easy_install kicost
Searching for kicost
Reading https://pypi.python.org/simple/kicost/
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable ‘Py_DEBUG’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable ‘WITH_PYMALLOC’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
Downloading https://files.pythonhosted.org/packages/7b/e4/04806a6834df2d056e70c8cf35d7ceb56d22465274e7f66139692c5d2fa7/kicost-1.0.3.tar.gz#sha256=c0187e156352e26d5ada8475f54560c89db7db8cb9d4a825674973b3e8593766
Best match: kicost 1.0.3
Processing kicost-1.0.3.tar.gz
Writing C:\Users\Julia\AppData\Local\Temp\easy_install-rld_95bn\kicost-1.0.3\setup.cfg
Running kicost-1.0.3\setup.py -q bdist_egg --dist-dir C:\Users\Julia\AppData\Local\Temp\easy_install-rld_95bn\kicost-1.0.3\egg-dist-tmp-7xtumm87
c:\users\julia\appdata\local\programs\python\python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: ‘long_description_content_type’
warnings.warn(msg)
warning: no previously-included files matching ‘pycache’ found under directory ‘
warning: no previously-included files matching '
.py[co]’ found under directory ‘
warning: no files found matching '
.md’ under directory ‘docs’
File “build\bdist.win-amd64\egg\kicost\kicost_config.py”, line 108
rom kicost.edas import eda_dict
^
SyntaxError: invalid syntax

File “build\bdist.win-amd64\egg\kicost\kicost_kicadplugin.py”, line 55
def Run(self):
^
SyntaxError: import * only allowed at module level

creating c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg
Extracting kicost-1.0.3-py3.7.egg to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost\kicost_config.py”, line 108
rom kicost.edas import eda_dict
^
SyntaxError: invalid syntax

File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost\kicost_kicadplugin.py”, line 55
def Run(self):
^
SyntaxError: import * only allowed at module level

Adding kicost 1.0.3 to easy-install.pth file
Installing kicost-script.py script to c:\users\julia\appdata\local\programs\python\python37\Scripts
Installing kicost.exe script to c:\users\julia\appdata\local\programs\python\python37\Scripts

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg
Processing dependencies for kicost
Searching for babel>=2.6
Reading https://pypi.python.org/simple/babel/
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable ‘Py_DEBUG’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable ‘WITH_PYMALLOC’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
Downloading https://files.pythonhosted.org/packages/b8/ad/c6f60602d3ee3d92fbed87675b6fb6a6f9a38c223343ababdb44ba201f10/Babel-2.6.0-py2.py3-none-any.whl#sha256=6778d85147d5d85345c14a26aada5e478ab04e39b078b0745ee6870c2b5cf669
Best match: Babel 2.6.0
Processing Babel-2.6.0-py2.py3-none-any.whl
Installing Babel-2.6.0-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
writing requirements to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\Babel-2.6.0-py3.7.egg\EGG-INFO\requires.txt
Adding Babel 2.6.0 to easy-install.pth file
Installing pybabel-script.py script to c:\users\julia\appdata\local\programs\python\python37\Scripts
Installing pybabel.exe script to c:\users\julia\appdata\local\programs\python\python37\Scripts

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\babel-2.6.0-py3.7.egg
Searching for CurrencyConverter>=0.5
Reading https://pypi.python.org/simple/CurrencyConverter/
Downloading https://files.pythonhosted.org/packages/78/3f/00641ca92805452269d5445ab904c015baef6d452e8732d84e05cea29b6b/CurrencyConverter-0.13.6.tar.gz#sha256=188ea52855a5031608f02ca9ee48e00b61bef499cc7234cb98563f25cf655109
Best match: CurrencyConverter 0.13.6
Processing CurrencyConverter-0.13.6.tar.gz
Writing C:\Users\Julia\AppData\Local\Temp\easy_install-ogpri49o\CurrencyConverter-0.13.6\setup.cfg
Running CurrencyConverter-0.13.6\setup.py -q bdist_egg --dist-dir C:\Users\Julia\AppData\Local\Temp\easy_install-ogpri49o\CurrencyConverter-0.13.6\egg-dist-tmp-zd0_31b4
creating c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\currencyconverter-0.13.6-py3.7.egg
Extracting currencyconverter-0.13.6-py3.7.egg to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding currencyconverter 0.13.6 to easy-install.pth file
Installing currency_converter-script.py script to c:\users\julia\appdata\local\programs\python\python37\Scripts
Installing currency_converter.exe script to c:\users\julia\appdata\local\programs\python\python37\Scripts

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\currencyconverter-0.13.6-py3.7.egg
Searching for requests>=2.18.4
Reading https://pypi.python.org/simple/requests/
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable ‘Py_DEBUG’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable ‘WITH_PYMALLOC’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
Downloading https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8/requests-2.20.0-py2.py3-none-any.whl#sha256=a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279
Best match: requests 2.20.0
Processing requests-2.20.0-py2.py3-none-any.whl
Installing requests-2.20.0-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
writing requirements to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\requests-2.20.0-py3.7.egg\EGG-INFO\requires.txt
Adding requests 2.20.0 to easy-install.pth file

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\requests-2.20.0-py3.7.egg
Searching for tqdm>=4.4.0
Reading https://pypi.python.org/simple/tqdm/
Downloading https://files.pythonhosted.org/packages/91/55/8cb23a97301b177e9c8e3226dba45bb454411de2cbd25746763267f226c2/tqdm-4.28.1-py2.py3-none-any.whl#sha256=3c4d4a5a41ef162dd61f1edb86b0e1c7859054ab656b2e7c7b77e7fbf6d9f392
Best match: tqdm 4.28.1
Processing tqdm-4.28.1-py2.py3-none-any.whl
Installing tqdm-4.28.1-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding tqdm 4.28.1 to easy-install.pth file
Installing tqdm-script.py script to c:\users\julia\appdata\local\programs\python\python37\Scripts
Installing tqdm.exe script to c:\users\julia\appdata\local\programs\python\python37\Scripts

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\tqdm-4.28.1-py3.7.egg
Searching for yattag>=1.5.2
Reading https://pypi.python.org/simple/yattag/
Downloading https://files.pythonhosted.org/packages/ba/65/2c62e21d328a8472a438d9d255b69f862d969c703cd1425463bee728f8e8/yattag-1.10.0.tar.gz#sha256=0a3fe7fcbdd5886ebe4ef6c215627599bb13e93a8bc26d3e48789b02e5ddc5dc
Best match: yattag 1.10.0
Processing yattag-1.10.0.tar.gz
Writing C:\Users\Julia\AppData\Local\Temp\easy_install-0gi28_lk\yattag-1.10.0\setup.cfg
Running yattag-1.10.0\setup.py -q bdist_egg --dist-dir C:\Users\Julia\AppData\Local\Temp\easy_install-0gi28_lk\yattag-1.10.0\egg-dist-tmp-a82klhku
zip_safe flag not set; analyzing archive contents…
Copying yattag-1.10.0-py3.7.egg to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding yattag 1.10.0 to easy-install.pth file

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\yattag-1.10.0-py3.7.egg
Searching for lxml>=3.7.2
Reading https://pypi.python.org/simple/lxml/
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable ‘Py_DEBUG’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable ‘WITH_PYMALLOC’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
Downloading https://files.pythonhosted.org/packages/d7/9d/1aa28aa9d293a816baec6c37328d6465b722b2ff3f4d1e93ed56e87813ee/lxml-4.2.5-cp37-cp37m-win_amd64.whl#sha256=d3266bd3ac59ac4edcd5fa75165dee80b94a3e5c91049df5f7c057ccf097551c
Best match: lxml 4.2.5
Processing lxml-4.2.5-cp37-cp37m-win_amd64.whl
Installing lxml-4.2.5-cp37-cp37m-win_amd64.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
writing requirements to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\lxml-4.2.5-py3.7-win-amd64.egg\EGG-INFO\requires.txt
Adding lxml 4.2.5 to easy-install.pth file

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\lxml-4.2.5-py3.7-win-amd64.egg
Searching for future>=0.15.0
Reading https://pypi.python.org/simple/future/
Downloading https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz#sha256=e39ced1ab767b5936646cedba8bcce582398233d6a627067d4c6a454c90cfedb
Best match: future 0.16.0
Processing future-0.16.0.tar.gz
Writing C:\Users\Julia\AppData\Local\Temp\easy_install-gclzxmnt\future-0.16.0\setup.cfg
Running future-0.16.0\setup.py -q bdist_egg --dist-dir C:\Users\Julia\AppData\Local\Temp\easy_install-gclzxmnt\future-0.16.0\egg-dist-tmp-wif7ukkz
warning: no files found matching ‘.au’ under directory ‘tests’
warning: no files found matching '
.gif’ under directory ‘tests’
warning: no files found matching ‘*.txt’ under directory ‘tests’
zip_safe flag not set; analyzing archive contents…
future.backports.test.pycache.ssl_servers.cpython-37: module references file
future.backports.test.pycache.support.cpython-37: module references file
future.standard_library.pycache.init.cpython-37: module references file
future.standard_library.pycache.init.cpython-37: module references path
future.utils.pycache.init.cpython-37: module MAY be using inspect.stack
past.builtins.pycache.misc.cpython-37: module MAY be using inspect.stack
past.translation.pycache.init.cpython-37: module references file
past.translation.pycache.init.cpython-37: module references path
creating c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\future-0.16.0-py3.7.egg
Extracting future-0.16.0-py3.7.egg to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding future 0.16.0 to easy-install.pth file
Installing futurize-script.py script to c:\users\julia\appdata\local\programs\python\python37\Scripts
Installing futurize.exe script to c:\users\julia\appdata\local\programs\python\python37\Scripts
Installing pasteurize-script.py script to c:\users\julia\appdata\local\programs\python\python37\Scripts
Installing pasteurize.exe script to c:\users\julia\appdata\local\programs\python\python37\Scripts

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\future-0.16.0-py3.7.egg
Searching for XlsxWriter>=0.7.3
Reading https://pypi.python.org/simple/XlsxWriter/
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable ‘Py_DEBUG’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable ‘WITH_PYMALLOC’ is unset, Python ABI tag may be incorrect
warn=(impl == ‘cp’)):
Downloading https://files.pythonhosted.org/packages/3d/1b/4caecd4efde1d41ba3bef1a81027032a7a6dff7d5112e1731f232c0addb9/XlsxWriter-1.1.2-py2.py3-none-any.whl#sha256=7cc07619760641b67112dbe0df938399d4d915d9b9924bb58eb5c17384d29cc6
Best match: XlsxWriter 1.1.2
Processing XlsxWriter-1.1.2-py2.py3-none-any.whl
Installing XlsxWriter-1.1.2-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding XlsxWriter 1.1.2 to easy-install.pth file
Installing vba_extract.py script to c:\users\julia\appdata\local\programs\python\python37\Scripts

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\xlsxwriter-1.1.2-py3.7.egg
Searching for beautifulsoup4>=4.3.2
Reading https://pypi.python.org/simple/beautifulsoup4/
Downloading https://files.pythonhosted.org/packages/21/0a/47fdf541c97fd9b6a610cb5fd518175308a7cc60569962e776ac52420387/beautifulsoup4-4.6.3-py3-none-any.whl#sha256=194ec62a25438adcb3fdb06378b26559eda1ea8a747367d34c33cef9c7f48d57
Best match: beautifulsoup4 4.6.3
Processing beautifulsoup4-4.6.3-py3-none-any.whl
Installing beautifulsoup4-4.6.3-py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
writing requirements to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\beautifulsoup4-4.6.3-py3.7.egg\EGG-INFO\requires.txt
Adding beautifulsoup4 4.6.3 to easy-install.pth file

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\beautifulsoup4-4.6.3-py3.7.egg
Searching for pytz>=0a
Reading https://pypi.python.org/simple/pytz/
Downloading https://files.pythonhosted.org/packages/52/8b/876c5745f617630be90cfb8fafe363c6d7204b176dc707d1805d1e9a0a35/pytz-2018.6-py2.py3-none-any.whl#sha256=91e3ccf2c344ffaa6defba1ce7f38f97026943f675b7703f44789768e4cb0ece
Best match: pytz 2018.6
Processing pytz-2018.6-py2.py3-none-any.whl
Installing pytz-2018.6-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding pytz 2018.6 to easy-install.pth file

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\pytz-2018.6-py3.7.egg
Searching for urllib3<1.25,>=1.21.1
Reading https://pypi.python.org/simple/urllib3/
Downloading https://files.pythonhosted.org/packages/8c/4b/5cbc4cb46095f369117dcb751821e1bef9dd86a07c968d8757e9204c324c/urllib3-1.24-py2.py3-none-any.whl#sha256=8819bba37a02d143296a4d032373c4dd4aca11f6d4c9973335ca75f9c8475f59
Best match: urllib3 1.24
Processing urllib3-1.24-py2.py3-none-any.whl
Installing urllib3-1.24-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
writing requirements to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\urllib3-1.24-py3.7.egg\EGG-INFO\requires.txt
Adding urllib3 1.24 to easy-install.pth file

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\urllib3-1.24-py3.7.egg
Searching for idna<2.8,>=2.5
Reading https://pypi.python.org/simple/idna/
Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl#sha256=156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e
Best match: idna 2.7
Processing idna-2.7-py2.py3-none-any.whl
Installing idna-2.7-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding idna 2.7 to easy-install.pth file

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\idna-2.7-py3.7.egg
Searching for chardet<3.1.0,>=3.0.2
Reading https://pypi.python.org/simple/chardet/
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl#sha256=fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691
Best match: chardet 3.0.4
Processing chardet-3.0.4-py2.py3-none-any.whl
Installing chardet-3.0.4-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding chardet 3.0.4 to easy-install.pth file
Installing chardetect-script.py script to c:\users\julia\appdata\local\programs\python\python37\Scripts
Installing chardetect.exe script to c:\users\julia\appdata\local\programs\python\python37\Scripts

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\chardet-3.0.4-py3.7.egg
Searching for certifi>=2017.4.17
Reading https://pypi.python.org/simple/certifi/
Downloading https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl#sha256=339dc09518b07e2fa7eda5450740925974815557727d6bd35d319c1524a04a4c
Best match: certifi 2018.10.15
Processing certifi-2018.10.15-py2.py3-none-any.whl
Installing certifi-2018.10.15-py2.py3-none-any.whl to c:\users\julia\appdata\local\programs\python\python37\lib\site-packages
Adding certifi 2018.10.15 to easy-install.pth file

Installed c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\certifi-2018.10.15-py3.7.egg
Finished processing dependencies for kicost

C:\Users\Julia>

I decided to give the GUI a try, since I much prefer a GUI. I was told I was missing some dependencies so I followed the instructions to add them:

C:\Users\Julia>kicost
You don’t have the wxPython dependence to run the GUI interface. Run once of the follow commands in terminal to install them:
pip3 install -U wxPython # For Windows & macOS
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython # For Linux 16.04
Or download from last version from https://wxpython.org/pages/downloads/

C:\Users\Julia>pip install -U wxPython
Collecting wxPython
Downloading https://files.pythonhosted.org/packages/34/41/e0e109a72966f596a5b93123d94eaabd53509ef6766fa3321b4bfadbbb14/wxPython-4.0.3-cp37-cp37m-win_amd64.whl (22.7MB)
100% |████████████████████████████████| 22.7MB 1.3MB/s
Collecting PyPubSub (from wxPython)
Downloading https://files.pythonhosted.org/packages/ab/9e/3b50915d3346971aaa49074425788598ee4907e67c097e013f1a862bd45c/Pypubsub-4.0.0-py3-none-any.whl (63kB)
100% |████████████████████████████████| 71kB 3.4MB/s
Collecting six (from wxPython)
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: PyPubSub, six, wxPython
The scripts helpviewer.exe, img2png.exe, img2py.exe, img2xpm.exe, pycrust.exe, pyshell.exe, pyslices.exe, pyslicesshell.exe, pywxrc.exe, wxdemo.exe, wxdocs.exe and wxget.exe are installed in ‘c:\users\julia\appdata\local\programs\python\python37\Scripts’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed PyPubSub-4.0.0 six-1.11.0 wxPython-4.0.3

The stuff at the end about things missing from PATH sounds interesting, but unfortunately I have no idea how to “add this directory to PATH”. So after this possibly successful (but maybe not) install, I try to launch the GUI again:

C:\Users\Julia>kicost
Traceback (most recent call last):
File “C:\Users\Julia\AppData\Local\Programs\Python\Python37\Scripts\kicost-script.py”, line 11, in
load_entry_point(‘kicost==1.0.3’, ‘console_scripts’, ‘kicost’)()
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost_main_.py”, line 215, in main
kicost_gui() # Use the user guide if no input is given.
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost\kicost_gui.py”, line 995, in kicost_gui
frame = formKiCost(None)
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost\kicost_gui.py”, line 493, in init
self.set_properties()
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost\kicost_gui.py”, line 805, in set_properties
s=numbers.get_currency_symbol(currency),
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\babel-2.6.0-py3.7.egg\babel\numbers.py”, line 143, in get_currency_symbol
return Locale.parse(locale).currency_symbols.get(currency, currency)
AttributeError: ‘NoneType’ object has no attribute ‘currency_symbols’

No idea what went wrong. OK, let’s try without the GUI just to see if I can get it to do something. The usage example given in the docs

kicost -i schem.xml

is obviously not going to work for me as-is, since my xml is on a network volume. So I take a stab at specifying the path in the invocation:

kicost -i X:\Projects\My Customer\A Great Project\Circuitry\schema.xml

But apparently it’s still 1979 somewhere in the world, where spaces are mysterious, dangerous, impossible-to-parse characters that must not be allowed in paths. Alright, move the file to a local path that doesn’t contain spaces, and

C:\Users\Julia>kicost -i C:\Users\Julia\Documents\Projects\MyCustomer\MyProject\schem.xml
Progress: 0%| | 0/81 [00:00<?, ?part/s]Traceback (most recent call last):
File “C:\Users\Julia\AppData\Local\Programs\Python\Python37\Scripts\kicost-script.py”, line 11, in
load_entry_point(‘kicost==1.0.3’, ‘console_scripts’, ‘kicost’)()
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost_main_.py”, line 257, in main
dist_list=dist_list, currency=args.currency)
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost\kicost.py”, line 192, in kicost
dist_octopart.query_part_info(parts, distributor_dict, currency)
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost\distributors\dist_octopart.py”, line 364, in query_part_info
get_part_info(octopart_query, parts)
File “c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost-1.0.3-py3.7.egg\kicost\distributors\dist_octopart.py”, line 257, in get_part_info
for result in results:
TypeError: ‘NoneType’ object is not iterable

So I’m stuck at this point and would appreciate any help, thanks!

Basics of command line: first comes the command (program name), then come the arguments, separated by spaces. If there’s a space inside one argument it must be quoted:

kicost -i “X:\Projects\My Customer\A Great Project\Circuitry\schema.xml”

EDIT: BTW, this ***** forum software likes to have it’s own quote marks, you can’t just copy from the line above and run it in a command line interpreter. It must have two " quote marks.

1 Like

Thanks. Great illustration of why every program should have a GUI :slight_smile:

Command line syntax aside, KiCost still doesn’t work for me, reporting the “TypeError” when invoked from the command line, and an “AttributeError” when I try to launch the GUI. All the warnings and syntax errors during installation are worrisome, despite my having followed the instructions.

We have a GUI. Type kicost (just) in terminal, it will be loaded.
Prefer to use pip or pip3 instead easy_install, it deal better with some dependencies.

About the issues we are having 2 issues recently:

  1. Not full compatibility with Python 2 https://github.com/xesscorp/KiCost/issues/332
  2. The Octopart key in code is not valid anymore https://github.com/xesscorp/KiCost/issues/331 (a workaround is create your own register at Octopart.com as explained in issue 332)

Your error is due (2).

To be more obvious to users there is the issue https://github.com/xesscorp/KiCost/issues/151 to create the correct OS shortcuts to KiCost. There is also (in alpha) the Pcbnew plugin that just provide a shortcut at KiCad-PcbNew to open KiCost with the file name already filled in the GUI.

But we just have 2 active developers (in them rest time) at the moment, so I open KiCost - call of developers

Thanks, @hildogjr. I am using Python 3.7, current stable release. I will try a pip install and to set up the Octopart thing. Or maybe there is a way to install an older version that works without Octopart?

Yes, by (in Linux)
sudo -H pip3 install -U git+https://github.com/xesscorp/KiCost.git@scrape_modules

This used the web scrape technic, and may not work due the recent changes at each distributor web page.

It doesn’t seem to me that the errors I’m seeing have anything to do with Octopart. I did a pip uninstall and then reinstall of KiCost. When I just type “kicost” in the command prompt, the error is regarding a currency symbol. If I try to invoke KiCost via command line, the error has to do with a missing attribute “find_all”. These error messages are not mentioned in the issue reports having to do with the Octopart apikey.

Attempted GUI launch:

C:\Users\Julia>kicost
Traceback (most recent call last):
  File "C:\Users\Julia\AppData\Local\Programs\Python\Python37\Scripts\kicost-script.py", line 11, in <module>
    load_entry_point('kicost==1.0.3', 'console_scripts', 'kicost')()
  File "c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost\__main__.py", line 215, in main
    kicost_gui() # Use the user guide if no input is given.
  File "c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost\kicost_gui.py", line 995, in kicost_gui
    frame = formKiCost(None)
  File "c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost\kicost_gui.py", line 493, in __init__
    self.set_properties()
  File "c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost\kicost_gui.py", line 805, in set_properties
    s=numbers.get_currency_symbol(currency),
  File "c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\babel-2.6.0-py3.7.egg\babel\numbers.py", line 143, in get_currency_symbol
    return Locale.parse(locale).currency_symbols.get(currency, currency)
AttributeError: 'NoneType' object has no attribute 'currency_symbols'

Attempted command line invocation:

C:\Users\Julia>kicost -i "X:\Projects\My Client\A Project\Circuitry\V2\aproject.sch"
Traceback (most recent call last):
  File "C:\Users\Julia\AppData\Local\Programs\Python\Python37\Scripts\kicost-script.py", line 11, in <module>
    load_entry_point('kicost==1.0.3', 'console_scripts', 'kicost')()
  File "c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost\__main__.py", line 257, in main
    dist_list=dist_list, currency=args.currency)
  File "c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost\kicost.py", line 119, in kicost
    p, info = eda_module.get_part_groups(in_file[i_prj], ignore_fields, variant[i_prj])
  File "c:\users\julia\appdata\local\programs\python\python37\lib\site-packages\kicost\edas\eda_kicad.py", line 160, in get_part_groups
    for c in root.find('components').find_all('comp'):
AttributeError: 'NoneType' object has no attribute 'find_all'

These errors have nothing to do with currency symbols or find_all. NoneType means that there’s no object at that point.

Locale.parse(locale)

and

root.find(‘components’)

both return nothing.
Unfortunately this doesn’t help you at all.

Thanks for the clarification, @eelik. But yeah, I’m stuck :frowning:

You used

kicost -i "X:\Projects\My Client\A Project\Circuitry\V2\aproject.sch"

but you have to use

kicost -i "X:\Projects\My Client\A Project\Circuitry\V2\aproject.xml"

So, kicost doesn’t work directly from your schematic file. You have to generate the BOM first.

Check the “quick start” video in https://github.com/xesscorp/KiCost

About the GUI, I have to investigate yet.

Ah, yes, doing too many things at once. When I pass the xml BOM, I get the octopart-related error that I had the other day, thanks.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.