NumPy import error causes Path to fail

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

NumPy import error causes Path to fail

Post by falviani »

Hi All,

I just did a completely fresh build of FreeCAD from master (new directories, clone from Git, etc.). The about info is

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.29432 (Git)
Build type: Debug
Branch: master
Hash: 45d7151dfa89e974e20fbcfae096b65ed406da23
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * FC_TabbedBoxWorkbench
When I try to open the path workbench, I get the following error:
NumPy_Error.png
NumPy_Error.png (17.84 KiB) Viewed 1211 times
Should I use pip from the python console to update this (current version appears to be 1.23)? If not, what is recommended?

Thanks in advance,
Frank Alviani
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: NumPy import error causes Path to fail

Post by sliptonic »

I don't think this is a Path-specific problem. Try loading the FEM and Arch workbenches since they both use Numpy too.
We should probably move the post to the Install/Compile subforum.
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: NumPy import error causes Path to fail

Post by falviani »

Hi Sliptonic,

'FEM and Arch both open fine - in fact, all other workbenches open fine.

I ran the test suite (test all) : the tests seem to die on draftcreation (unless waiting 5 minutes for it to complete was not enough).

So, it does seem to be specific to the Path workbench. I have no problems if you want to move this to the Install/Compile forum. I didn't put it there to start with since I've gotten no replies to several previous posts I made.

Thanks for taking the time to reply,
Frank Alviani
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: NumPy import error causes Path to fail

Post by Russ4262 »

Evening,
I also build on Windows from source. I had a few issues a week or two back, around the time of the 0.20 official release, and then a few months before that. Most recent fix for my build failure was finding the most recent LibPack, version 2.6 at https://github.com/FreeCAD/FreeCAD-LibPack/tags. Also, there have been some recent (0.21_pre) breaks in FreeCAD build as seen in PRs that have been fixes for the breaks.

Also, not that it might matter, personally, I have never attempted a debug build. I always have built release versions. I do not have any idea about how to use the debug version for debugging proper. I imagine it is quite helpful for C++ coding on the project. I might try to build the debug version to see if it builds successfully for me with my setup.

Are you using MS Visual Studio Community 2019 or 2022? Or other build setup?

Sorry for the build troubles. I feel your frustration.

Russell

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.29419 +11 (Git)
Build type: Release
Branch: master_prs
Hash: 86110d745cfcc2301e00a55ff825e408ac4e661c
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * FC_SU
  * Z_MacroStartup
**LibPack: 2.6
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: NumPy import error causes Path to fail

Post by falviani »

Hi,

Thanks for taking the time to respond. I usually build debug, since that's the default. I'm using VS2022; just switched to it a few days ago. Now that I've started from scratch - new directories, clone from master, etc. - things have been much smoother. Seems like "crud" accumulates over time, and tracking it down is nearly impossible.

I'll wait to hear from Sliptonic before I take my next step. It's probably something tiny...

-Frank
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: NumPy import error causes Path to fail

Post by sliptonic »

falviani wrote: Tue Jul 05, 2022 1:23 am I'll wait to hear from Sliptonic before I take my next step. It's probably something tiny...
I bring nothing to the table. You can leave it here if you like. Perhaps someone else has insight.
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: NumPy import error causes Path to fail

Post by Russ4262 »

Evening.
I am still using MS Visual Studio 2019. I just finished building a recent master with debug version successfully. Upon running the debug build, I get the following error:

Code: Select all

00:00:52  Cannot find icon: Path_Area_View
00:00:52  Accelerator conflict between Std_ViewFullscreen (F11) and Std_MacroStepInto (F11)
00:00:52  Accelerator conflict between Std_MacroStepInto (F11) and Std_ViewFullscreen (F11)
00:00:52  FC_SU macro is enabled
00:00:52  

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "C:\Users\Public\Documents\FreeCAD_Install\bin\FreeCAD_d.exe"
  * The NumPy version is: "1.19.3"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

I did not have to load a workbench because I have FC set to autoload the Path workbench upon startup.

It appears that the error is unique to the debug build. I have not changed anything on my build setup, or FC source, except for changing the build type to debug, from my standard release. Based on this, I suggest you build the release version, as it is building and executing successfully without the reported error for me.

Additionally, I confirm the error you report here with the debug build. Consequently, I suggest you report the bug in the compile forum, or perhaps a forum admin can move this thread to that forum. As indicated by Sliptonic, the bug does not appear to be Path related, but related to the debug build.

Have a great week.
Russell

Below is the debug About info:

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.29434 +11 (Git)
Build type: Debug
Branch: master_prs
Hash: 7007fc82c3e7a53608d47fd9c2f65d22fb23b5e3
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * FC_SU
  * Z_MacroStartup
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: NumPy import error causes Path to fail

Post by GeneFC »

Debug is generally only useful if someone wants to actually debug something during code development. Most of the serious C++ development occurs on Linux, not Windows.

However, there is at least one very active developer, Uwestoehr, who works on Windows. I recall that he has at times said the CMake files for Windows debug builds had some missing or incorrect dependencies.

I only do Release builds, so I cannot give specifics.

Gene
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: NumPy import error causes Path to fail

Post by falviani »

Hi All,

Thanks for the feedback. I'll build the release version and report back the results.

Frank
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: NumPy import error causes Path to fail

Post by falviani »

Hi,

I built a release with debug info version, using current SDK and C choices, C++17 etc. No change.

I'm going to try updating NumPy to the current version from the python console to see what happens. The worst is that I nuke the directory and start fresh again. [edit] it doesn't appear that pip is built into the python contained in the LibPack. :( So much for that idea.

Could an administrator please move this to the compile/install forum - perhaps somebody else has a solution.

Thanks for the suggestions!
-Frank
Post Reply