knipknap / better-tool-library

A FreeCAD addon and command line tool for managing tool libraries
MIT License
20 stars 10 forks source link

BTL does not load on FreeCAD versions using Python 3.9 #20

Closed DavidHenri008 closed 9 months ago

DavidHenri008 commented 10 months ago

I just installed the latest 0.9.9 version in my FreeCad 0.21.2 and unfortunately, the icon is not displayed. I rebooted several times and still not showing...

image image

Edit: I just saw some error image

knipknap commented 10 months ago

Looks like you are using a FreeCAD with an old Python version. The error references a line that uses the new "match" statement, which is available starting from Python 3.10.

DavidHenri008 commented 10 months ago

I have python version 3.10 installed. image But I am not pointing to it in the settings image

knipknap commented 10 months ago

I am not sure how that works on Windows. Perhaps FreeCAD ships with an included Python? In any case, does it work when you define the path?

DavidHenri008 commented 10 months ago

Unfortunately not. I still have the issue after I set the path.

DavidHenri008 commented 10 months ago

Python 3 is not compatible with python 2. Do you run this with version 2 or 3 of python?

knipknap commented 10 months ago

Python 2 is EOL. BTL uses Py 3 only.

knipknap commented 10 months ago

I just pushed a commit to remove the match statement. It should now be compatible with Python 3.9

DavidHenri008 commented 10 months ago

I will give it a try. It is strange because the match statement was supported from 3.10 and up... I will try to identify which version of python is executed by my FreeCad.

DavidHenri008 commented 10 months ago

Oh wow... look at this, I am somehow running version 3.8: image

DavidHenri008 commented 10 months ago

So on windows, the python version is distributed with FreeCad...

knipknap commented 10 months ago

It shouldn't matter anymore, BTL master should work anyway.

knipknap commented 9 months ago

As the compatibility issue was fixed, I am closing the issue. Feel free to re-open if the problem persists.