sparkmicro / Ki-nTree

Fast part creation for KiCad and InvenTree
GNU General Public License v3.0
178 stars 33 forks source link

Error in dill after install #161

Closed mKlemmOrg closed 1 year ago

mKlemmOrg commented 1 year ago

Hey, first: THANKS for sharing this beautiful tool!

After installing (using pip under windows)

$ python -m venv env-kintree
$ pip install -U kintree

I get an error after typing in my supplier settings (Digi-Key and Mouser) and clicking "Test".

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\marku\Documents\kintree\env-kintree\Lib\site-packages\multiprocess\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\marku\Documents\kintree\env-kintree\Lib\site-packages\multiprocess\spawn.py", line 126, in _main
    self = reduction.pickle.load(from_parent)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\marku\Documents\kintree\env-kintree\Lib\site-packages\dill\_dill.py", line 313, in load
    return Unpickler(file, ignore=ignore, **kwds).load()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\marku\Documents\kintree\env-kintree\Lib\site-packages\dill\_dill.py", line 525, in load
    obj = StockUnpickler.load(self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\marku\Documents\kintree\env-kintree\Lib\site-packages\dill\_dill.py", line 659, in _create_code
    if len(args) == 16: return CodeType(*args)
                               ^^^^^^^^^^^^^^^
TypeError: code() argument 13 must be str, not int

My package versions:

$ pip list
Package                 Version
----------------------- ---------
anyio                   3.7.0
certauth                1.3.0
certifi                 2023.5.7
cffi                    1.15.1
charset-normalizer      3.1.0
cli-exit-tools          1.2.3.2
click                   8.1.3
colorama                0.4.6
cryptography            41.0.1
decorator               5.1.1
digikey-api             1.0.0
dill                    0.3.4
filelock                3.12.2
flet                    0.5.2
flet-core               0.5.2
h11                     0.14.0
httpcore                0.16.3
httpx                   0.23.3
idna                    3.4
inflection              0.5.1
inventree               0.10.1
kintree                 1.0.1
kiutils                 1.4.2
lib-detect-testenv      2.0.3
mouser                  0.1.3
multiprocess            0.70.12.2
oauthlib                3.2.2
packaging               23.1
pip                     23.1.2
pycparser               2.21
pyOpenSSL               23.2.0
PyYAML                  5.4.1
repath                  0.9.0
requests                2.31.0
requests-file           1.5.1
retrying                1.3.4
rfc3986                 1.5.0
setuptools              65.5.0
six                     1.16.0
sniffio                 1.3.0
thefuzz                 0.19.0
tldextract              3.4.4
urllib3                 2.0.3
validators              0.19.0
watchdog                2.3.1
websocket-client        1.6.0
websockets              10.4
wrapt                   1.15.0
wrapt-timeout-decorator 1.3.12.2

By updating dill to the recent version 0.3.6, the problem is gone:

$ pip install -U dill
Requirement already satisfied: dill in c:\users\marku\documents\kintree\env-kintree\lib\site-packages (0.3.4)
Collecting dill
  Using cached dill-0.3.6-py3-none-any.whl (110 kB)
Installing collected packages: dill
  Attempting uninstall: dill
    Found existing installation: dill 0.3.4
    Uninstalling dill-0.3.4:
      Successfully uninstalled dill-0.3.4
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
wrapt-timeout-decorator 1.3.12.2 requires dill<0.3.5,>0.3.0; sys_platform == "win32", but you have dill 0.3.6 which is incompatible.
Successfully installed dill-0.3.6

I run into the exact same behavior/error when cloning the source and running the application in the python debugger.

Not sure, which package requirement is broken here (not inside Ki-nTree) but I do not want to dig deeper. Not sure if now there is something wrong with wrapt_timeout_decorator and if I will run into other issues.

Thought sharing this could be helpful for other people! Maybe there is a more elegant solution?

Thanks! Markus

eeintech commented 1 year ago

Hi @mKlemmOrg !

Thanks for reporting this issue, I have labeled it as documentation for reference for future user, I did not experience it myself but maybe it can help someone, great feedback!