Octopart.com TypeError: 'NoneType' object is not iterable
See original GitHub issueIssue / Problem report
I’m trying to get “Octopart”, “LCSC”, and “RS Components” to populate. Every part of my Config.yaml is enabled, except Octopart, and appears to be working. Problems occur when I enable Octopart with either of the client values below.
Octopart:
# Octopart API Key
key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
# API level: 3 or 4
# level: 4
# The extended API is for the Pro plan
# extended: false
# Only enabled if the key is defined
enable: true
# Directory for the APIs caches
cache_path: ~/.cache/kicost/Octopart
I have my free Octopart Key installed, replaced below with xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. When I enable Octopart, this is what happens. I tried both “Client” values (ID and Secret) and the same thing happens with either:
-
C:\Users\craig\Desktop\555\KiCAD>kicost --version KiCost v1.1.11
-
DEBUG:Distributors solved {‘tme’}, remaining {‘arrow’, ‘rs’, ‘lcsc’} (kicost.distributors - log.py:115) DEBUG:Considering: Octopart [‘arrow’, ‘digikey’, ‘farnell’, ‘lcsc’, ‘mouser’, ‘newark’, ‘rs’, ‘tme’] (kicost.distributors - log.py:115)
- Octopart [api] (https://octopart.com/) DEBUG:# Getting part data from Octopart… (kicost.distributors - log.py:115) DEBUG:Queries 3 (kicost.distributors - log.py:115) DEBUG:Cached entries 0 (kicost.distributors - log.py:115) DEBUG:URL http://octopart.com/api/v4/rest/parts/match query: (kicost.distributors - log.py:115) DEBUG:queries=[{“reference”: “1”, “mpn”: “2N3906”}, {“reference”: “2”, “mpn”: “10K”}, {“reference”: “5”, “mpn”: “CA0555EX”}]&apikey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (kicost.distributors - log.py:115) DEBUG:{ “errors”: [ { “message”: “No app for token xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx not found” } ], “data”: null } (kicost.distributors - log.py:115) DEBUG:Status Code: <200> (kicost.distributors - log.py:115) Progress: 0%| | 0/3 [00:00<?, ?part/s]Traceback (most recent call last): File “C:\Program Files\KiCad\6.0\bin\Lib\runpy.py”, line 197, in run_module_as_main return run_code(code, main_globals, None, File “C:\Program Files\KiCad\6.0\bin\Lib\runpy.py”, line 87, in run_code exec(code, run_globals) File "C:\Program Files\KiCad\6.0\bin\Scripts\kicost.exe_main.py", line 7, in <module> File "C:\Program Files\KiCad\6.0\bin\Lib\site-packages\kicost_main.py", line 487, in main main_real() File "C:\Program Files\KiCad\6.0\bin\Lib\site-packages\kicost_main.py", line 477, in main_real kicost(in_file=args.input, eda_name=args.eda, File “C:\Program Files\KiCad\6.0\bin\Lib\site-packages\kicost\kicost.py”, line 251, in kicost query_part_info(parts, dist_list, currency) File “C:\Program Files\KiCad\6.0\bin\Lib\site-packages\kicost\kicost.py”, line 78, in query_part_info get_dist_parts_info(parts, dist_list, currency) File “C:\Program Files\KiCad\6.0\bin\Lib\site-packages\kicost\distributors_init_.py”, line 50, in get_dist_parts_info distributor_class.get_dist_parts_info(parts, dist_list, currency) File “C:\Program Files\KiCad\6.0\bin\Lib\site-packages\kicost\distributors\distributor.py”, line 144, in get_dist_parts_info solved = api.query_part_info(parts, list(remaining), currency) File “C:\Program Files\KiCad\6.0\bin\Lib\site-packages\kicost\distributors\api_octopart.py”, line 448, in query_part_info api_octopart.get_part_info(unsolved[slc]) File “C:\Program Files\KiCad\6.0\bin\Lib\site-packages\kicost\distributors\api_octopart.py”, line 211, in get_part_info for r in results: TypeError: ‘NoneType’ object is not iterable Progress: 0%| | 0/3 [00:00<?, ?part/s]
C:\Users\craig\Desktop\555\KiCAD>
-
Write the command used to call KiCost (or the graphical interface configuration); kicost -w -i 555.xml --debug 8
-
One BoM to reproduce the error (with the EDA version). 555.zip
Issue Analytics
- State:
- Created a year ago
- Comments:13
Top GitHub Comments
I suspect you had a mix of files from different versions
Thanks for reporting, I patched the code so the setup.py can run even when TQDM isn’t installed.
I performed an uninstall/install of KiCost on the problematic system, and now KiCost works on that system. Both prior to uninstall/install and after kicost --version said 1.1.13.
Being the not so trusting sort, I tried installing KiCost on a 3rd development system, also Windows 11 (the problematic system is Windows 10 which is now working).
I get this
I did finally make it install, but had to
Before I could finally get:
KiCost now works on the 3rd system, which didn’t have KiCost previously installed.