Skip to content

AddonManager: Unable to install the Python deps and erroneuously reports it successfully installed addon/workbench #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
raindropsfromsky opened this issue Feb 3, 2025 · 21 comments · Fixed by FreeCAD/FreeCAD#19384

Comments

@raindropsfromsky
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Addon manager is unable to install the Networkx Python dependency for the Sheet Metal addon

I had raised this issue with the GitHub for Sheet Metal addon, but the developer has confirmed that this bug is with the Addon Manager.

Full version info

OS: Windows 11 build 26100
Architecture: x86_64
Version: 1.1.0dev.40041 (Git) Conda
Build type: Release
Branch: main
Hash: 64a4f6e3669279e5dbe9cb59d8e0123eaeb70833
Python 3.11.11, Qt 5.15.15, Coin 4.0.3, Vtk 9.3.0, OCC 7.8.1
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: OpenDark.qss/OpenDark/Fusion
Logical/physical DPI: 96/123.928
Installed mods: 
  * Beltrami 1.1.0
  * CommandPanel
  * CurvedShapes 1.0.13
  * Curves 0.6.54
  * ExplodedAssembly
  * fasteners 0.5.37
  * frame 0.1.1
  * FrameForge 0.1.2
  * FreeCAD-Ribbon 1.7.0
  * freecad.gears 1.3.0
  * FreeGrid 2.2.0
  * OpenTheme 2024.9.1
  * parts_library
  * Quetzal 1.1.0
  * SearchBar 1.3.3
  * sheetmetal 0.7.5
  * Silk 0.1.5
  * symbols_library

Subproject(s) affected?

None

Anything else?

Since that URL chronicles my entire conversation with the developer, I am just leaving the link here. All details can be checked there, including the logic for considering that the bug is with Addon Manager, and not the addon.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maxwxyz
Copy link
Contributor

maxwxyz commented Feb 3, 2025

@chennes FYI

@chennes
Copy link
Member

chennes commented Feb 3, 2025

I think what you're seeing is that networkx is taking more than ten seconds to install, so the Addon Manager assumes that pip has died. I've increased the built-in timeout to two minutes in this PR FreeCAD/FreeCAD#19384 which may resolve the issue.

@maxwxyz maxwxyz linked a pull request Feb 3, 2025 that will close this issue
@raindropsfromsky
Copy link
Author

raindropsfromsky commented Feb 3, 2025

Thanks!

I will crosscheck this resolution and give you a feedback.

I use the latest weekly builds.
When will this change appear in the weekly build?

@raindropsfromsky
Copy link
Author

raindropsfromsky commented Feb 5, 2025

I use the latest weekly builds.
When will this change appear in the weekly build?

I haven't received any response to that query.
I tried this today with the latest weekly 1.1.0dev.40077 (Git) Conda

FC waits for a longer time, but the same problem is still there.

Worse, FC reports an error like this:
Image

Even when I have not clicked yes/no button, FC still goes ahead with installation of the SheetMetal WB on its own.
Then FC reports that the SheetMetal WB was installed successfully.
How can it be called a successful installation if the dependency is missing??

Please re-open the issue.

@luzpaz luzpaz reopened this Feb 5, 2025
@luzpaz
Copy link
Contributor

luzpaz commented Feb 5, 2025

@chennes according to the feedback above it seems extending the timeout wasn't enough to fix the issue and also noted that AddonManager reports installing successfully even though it bailed on installing all 3rd party deps.

@luzpaz luzpaz changed the title BUG: Addon manager is unable to install the Networkx Python dependency for the Sheet Metal addon AddonManager: Unable to install the Python deps and erroneuously reports it successfully installed addon/workbench Feb 5, 2025
@Syres916
Copy link
Contributor

Syres916 commented Feb 5, 2025

@raindropsfromsky @luzpaz the merge of the fix was after weekly build 40077 was produced therefore it won't be available until Friday night/Saturday morning.

@luzpaz
Copy link
Contributor

luzpaz commented Feb 5, 2025

Oh shoot, my bad.

@luzpaz luzpaz closed this as completed Feb 5, 2025
@luzpaz
Copy link
Contributor

luzpaz commented Feb 5, 2025

If you can reproduce please ask to re-open.

@luzpaz
Copy link
Contributor

luzpaz commented Feb 6, 2025

@raindropsfromsky the fix is in revision 40090 and currently the latest weekly is at r40077. New build will be triggered tomorrow.

@raindropsfromsky
Copy link
Author

Even if the modification works, we need a positive confirmation that there is a good safety margin in the timings.
(If the wait time is borderline, the system may fail unpredictably.)

Do you want me to report any logs?

@raindropsfromsky
Copy link
Author

raindropsfromsky commented Feb 7, 2025

BTW the added wait time does not deal with the other issues I reported:

  1. Even if I do not allow , FC installs the WB, in absence of Networkx.
  2. FC reports WB installed successfully even as the other report says that the unfolder of Sheetmetal will not work because Networkx is missing. (conflicting reports)

Both problems need to be resolved.

Do you want me to replicate the bug twice (so that each problem can be addressed separately)?
Let this issue deal with the wait time for the Networkx server, which is a distinct issue.

@chennes
Copy link
Member

chennes commented Feb 7, 2025

I suggest waiting until the version you are testing includes FreeCAD/FreeCAD@fbb1225, which includes some additional code for ensuring that if a dependency fails to install, the Addon Manager does not continue to install the addon itself (unless you tell it to do so, of course).

@raindropsfromsky
Copy link
Author

Unfortunately I am unable to confirm whether that commit has appeared in the latest weekly.
I asked Deep Seek for the steps, and it guided me to check the logs.
I tried that, but cannot manage that task.
(Completely unfamiliar territory for me!)

Perhaps it would be easy for you to let me know when the change appears...


I installed the latest weekly that came out today.
I uninstalled Sheetmetal WB, and reinstalled it.

The behavior has certainly changed, but the problem is still there.

Here are the details:
FC reports that there is a dependency, but it does not even offer to install it first.
It asks the user to install it manually straightaway.
No links are provided for the Networkx installation either.
Image

After installing, FC gives a success message.
Image
It does not mention that without Networkx, the Sheetmetal WB will not work fully.
(It wrongly presumes that the dependency is already installed)

And sure enough, when FC is restarted, it reports that Networkx is missing.
Image

@hptsys
Copy link

hptsys commented Feb 10, 2025

Workaround:
I copied the install error message from the python console, stripped it from the commas and then just run a Linux terminal with it. Like:
/snap/freecad/1293/bin/python3 -m pip install --disable-pip-version-check --target /home/yourname/snap/freecad/common/Mod/../AdditionalPythonPackages/py310 networkx

After the successful installation of networkx, I installed the SheetMetal workbench without any hiccup.

@luzpaz luzpaz reopened this Feb 10, 2025
@luzpaz
Copy link
Contributor

luzpaz commented Feb 10, 2025

If you're reproducing the bug please add the full About info to your post. It helps us avoid misunderstandings.

@hptsys
Copy link

hptsys commented Feb 10, 2025

Sorry, a newbie mistake :-((, here it is:
OS: Ubuntu Core 22 (GNOME/gnome/xcb)
Architecture: x86_64
Version: 1.1.0dev.40043 (Git) Snap 1293
Build type: Release
Branch: main
Hash: 34d9ac00506ace1b930a4efa075b97bee810f1c7
Python 3.10.12, Qt 5.15.10, Coin 4.0.0, Vtk 7.1.1, OCC 7.7.1
Locale: English/Australia (en_AU)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Fusion
Logical/physical DPI: 96/92.4513
Installed mods:

  • Render 2024.12.15
  • fasteners 0.5.37
  • sheetmetal 0.7.5

@luzpaz
Copy link
Contributor

luzpaz commented Feb 10, 2025

Version: 1.1.0dev.40043 (Git) Snap 1293

Glad I asked. Fix is in r40090, see #39

@hptsys
Copy link

hptsys commented Feb 10, 2025

Sorry, not fixed.
Info:
OS: Ubuntu Core 22 (GNOME/gnome/xcb)
Architecture: x86_64
Version: 1.1.0dev.40128 (Git) Snap 1294
Build type: Release
Branch: main
Hash: f74a44ab4f92813d80902d8af30a41fb9ee25075
Python 3.10.12, Qt 5.15.15, Coin 4.0.0, Vtk 7.1.1, IfcOpenShell 0.8.1, OCC 7.7.1
Locale: English/Australia (en_AU)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Fusion
Logical/physical DPI: 96/92.4513
Installed mods:

  • Render 2024.12.15
  • fasteners 0.5.37

Steps to reproduce:

  1. Remove the existing installation of networkx:
    rm -r /home/myname/snap/freecad/common/Mod/../AdditionalPythonPackages/py310/networkx
    rm -r /home/myname/snap/freecad/common/Mod/../AdditionalPythonPackages/py310/networkx-3.4.2.dist-info

  2. Remove the SheetMetal installation and restart FC.

  3. Install SheetMetal. It warns it needs to add the networkx dependency. Reply yes to allow the addon manager to install it.
    I will get the below error:
    Failed to execute pip, which may be missing from your Python installation. Please ensure your system has pip installed and try again. The failed command was:
    freecad.pip --disable-pip-version-check
    Continue with installation of sheetmetal anyway?

Manual solution:

  1. Open a terminal and type:
    /snap/freecad/1293/bin/python3 -m pip install --disable-pip-version-check --target /home/myname/snap/freecad/common/Mod/../AdditionalPythonPackages/py310 networkx

  2. Return to FC and Instal SheetMetal.

@chennes
Copy link
Member

chennes commented Feb 10, 2025

That's actually an entirely different error: @luzpaz this was supposed to be the fix for running pip on snaps, any idea why freecad.pip isn't running there? (@maxwxyz can you split this to a new bug report about pip failing on a snap?)

@raindropsfromsky
Copy link
Author

raindropsfromsky commented Feb 10, 2025

Two of three problems discussed in this issue is now resolved.

I am using Version: 1.1.0dev.40122 on Windows 11 build 26100.

I removed SheetMetal, restarted FC, and then installed SheetMetal again.
It popped up a message about dependency about Networkx, and then waited.

I deliberately did not respond immediately.
It waited till I had clicked OK.
Only then did it proceed to install SheetMetal WB.

The SheetMetal installation took a very long time, and finally the Networkx got installed successfully.
(I was watching the progress live in the Report panel.)

After that, it went on to install SheetMetal successfully.

IINW the other problems are still pending.

  1. FC proceeded to install SheetMetal without user input.
  2. Even when the dependency was missing, FC reported successful installation of SheetMetal WB.

BTW, I tried to test what happens if I click No to Networkx.

Logically FC should install SheetMetal, but at the end report that the dependency was not installed at user request, and so the unfolded will not work as expected.

To test this scenario, I uninstalled SheetMetal.
But to my surprise, FC did NOT ask me whether to uninstall all dependencies also.
From the Report panel, I can see that it only uninstalled the SheetMetal WB; and NOT Networkx. [BUG]

I restarted FC and then installed SheetMetal.
This time it installed without installing Networkx (because the old installation was never uninstalled.)

Thus, I could not test what happens when the user does not allow installation of Networkx.

@chennes
Copy link
Member

chennes commented Feb 10, 2025

  • FC proceeded to install SheetMetal without user input.

I don't understand what you mean here by "without user input" -- it sounds from your description like it asked for the input it needed, got it, and then installed. Which input did it fail to ask for?

@chennes chennes transferred this issue from FreeCAD/FreeCAD Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@chennes @luzpaz @maxwxyz @raindropsfromsky @Syres916 @hptsys and others