Addon manager issue with new build with Python 3.10

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
drmacro
Veteran
Posts: 8982
Joined: Sun Mar 02, 2014 4:35 pm

Addon manager issue with new build with Python 3.10

Post by drmacro »

New OS install, new FC build (fresh git pull).

Code: Select all

Failed to connect to GitHub. Check your connection and proxy settings.
Failed to execute Git Python command: check installation of GitPython and/or git
There appears to be an issue connecting to the Wiki, therefore FreeCAD cannot retrieve the Wiki macro list at this time
Traceback (most recent call last):
  File "/home/mac/freecad-build/Mod/AddonManager/AddonManager.py", line 930, in update_progress_bar
    current_region_portion = (float(current_value) / float(max_value)) * region_size
ZeroDivisionError: float division by zero
OS: Manjaro Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.26974 (Git)
Build type: Release
Branch: master
Hash: 039d52f01be7ab732caead59fd95447861b31268
Python version: 3.10.1
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
Last edited by drmacro on Sun Jan 09, 2022 7:08 pm, edited 1 time in total.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon manager issue with new build

Post by chennes »

I merged PR 5339 shortly after the commit that you are working with: it does a better job of bailing out if it can't connect to GitHub (in theory!) so you shouldn't ever get to that division by zero.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
drmacro
Veteran
Posts: 8982
Joined: Sun Mar 02, 2014 4:35 pm

Re: Addon manager issue with new build

Post by drmacro »

chennes wrote: Fri Jan 07, 2022 9:38 pm I merged PR 5339 shortly after the commit that you are working with: it does a better job of bailing out if it can't connect to GitHub (in theory!) so you shouldn't ever get to that division by zero.
I installed gitpython after that, but it still didn't find workbenches and macros.

I'll build in the morning and give it go then.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
drmacro
Veteran
Posts: 8982
Joined: Sun Mar 02, 2014 4:35 pm

Re: Addon manager issue with new build

Post by drmacro »

chennes wrote: ping...
Different behavior today....don't work at all.

Code: Select all

 File "/home/mac/freecad-build/Mod/AddonManager/AddonManager.py", line 210, in network_connection_failed
09:33:55      if self.connection_check_message:
09:33:55  AttributeError: 'CommandAddonManager' object has no attribute 'connection_check_message'. Did you mean: 'show_connection_check_message'?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Syres
Veteran
Posts: 2899
Joined: Thu Aug 09, 2018 11:14 am

Re: Addon manager issue with new build

Post by Syres »

drmacro wrote: Sat Jan 08, 2022 3:30 pm
chennes wrote: ping...
Different behavior today....don't work at all.

Code: Select all

 File "/home/mac/freecad-build/Mod/AddonManager/AddonManager.py", line 210, in network_connection_failed
09:33:55      if self.connection_check_message:
09:33:55  AttributeError: 'CommandAddonManager' object has no attribute 'connection_check_message'. Did you mean: 'show_connection_check_message'?
The only way I can get my system to give that error (even resetting all Preferences) is to either remove my CAT5 cable from the NIC or change the Proxy to something that doesn't exist (i.e. to anything other than No Proxy). I must admit the code around line 208 to 218 in src/Mod/AddonManager/AddonManager.py should IMHO be something like (in order to give a better user experience):

Code: Select all

    def network_connection_failed(self, message: str) -> None:
        # This must run on the main GUI thread
        if self.network_connection_failed:
            QtWidgets.QMessageBox.critical(
                None, translate("AddonsInstaller", "Connection failed"), message
            )
        else:
            self.connection_check_message.close()


    def launch(self) -> None:


OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.26997 (Git)
Build type: Release
Branch: master
Hash: 968a9d83ae8648d09a6d168d3274c655038bac55
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon manager issue with new build

Post by chennes »

Syres wrote: Sat Jan 08, 2022 3:57 pm The only way I can get my system to give that error (even resetting all Preferences) is to either remove my CAT5 cable from the NIC or change the Proxy to something that doesn't exist (i.e. to anything other than No Proxy).
Well, but that's the case it's supposed to be handling (and isn't). On my system, it takes several seconds for the connection failure, so I didn't think of the case where the failure would be immediate (e.g. less than the half second I wait before deciding to show the "Attempting to connect..." window).

I don't know quite what your code is trying to do, with the function checking for its own existence? And not hiding the connection check message in the case when it exists? Can you explain further? In the meantime I'll fix the no-such-dialog error that @drmacro is seeing.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Syres
Veteran
Posts: 2899
Joined: Thu Aug 09, 2018 11:14 am

Re: Addon manager issue with new build

Post by Syres »

chennes wrote: Sat Jan 08, 2022 4:48 pm I don't know quite what your code is trying to do, with the function checking for its own existence?
I just did a

Code: Select all

print(dir(self))
in the function, to see if I could find another attribute to use and obviously (now) picked a function and not an attribute so I'll leave it to the experts, sorry for the noise!!
drmacro
Veteran
Posts: 8982
Joined: Sun Mar 02, 2014 4:35 pm

Re: Addon manager issue with new build

Post by drmacro »

Syres wrote: Sat Jan 08, 2022 4:56 pm
chennes wrote: Sat Jan 08, 2022 4:48 pm I don't know quite what your code is trying to do, with the function checking for its own existence?
I just did a

Code: Select all

print(dir(self))
in the function, to see if I could find another attribute to use and obviously (now) picked a function and not an attribute so I'll leave it to the experts, sorry for the noise!!
With today's git Addon manager works ok on Debian.

But, with the 3.10 Python on Manjaro it simply says check you network connection. Which is bogus...since I just did a git pull and CMake, etc. successfully.

On my other Manjaro machine I attempted to to build the AUR git and it fails during the build of the FEM code, also complaining about 3.10 Python.

As yet, I've not found the process of getting Manjaro (Arch, I guess) to use older Python.

Another thing I'm confused about, is the current location of workbenches and config info.

When I start FreeCAD (on the Manjaro machine) it says the user path has changed to /home/<user>/.local/share/FreeCAD move user modules and macros there.

While I do find this directory on the Debian machine, my macro directory is on a common network drive that I set all FreeCAD to point to.

And this works on the Debian (also on previous Ubuntu ). But, since I have not been able to use Addon manager with Manjaro, the .local/share is essentially empty.


Sorry about this post being a rambling stream of consciousness... :oops:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon manager issue with new build

Post by chennes »

I'll look into whether Python 3.10 made some change to urllib that would affect the connection check (well, more than the check... if that check doesn't work, nothing else will either). I don't have 3.10 on any of my systems yet, I'll see if I can put in on a VM and test it out. Thanks again for taking time to report the issues you're having.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
drmacro
Veteran
Posts: 8982
Joined: Sun Mar 02, 2014 4:35 pm

Re: Addon manager issue with new build

Post by drmacro »

chennes wrote: Sun Jan 09, 2022 3:54 pm I'll look into whether Python 3.10 made some change to urllib that would affect the connection check (well, more than the check... if that check doesn't work, nothing else will either). I don't have 3.10 on any of my systems yet, I'll see if I can put in on a VM and test it out. Thanks again for taking time to report the issues you're having.
Thanks.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply