python3.9 module 'pivy' has no attribute '__version__'

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by wmayer »

waebbl wrote: Sun Jul 24, 2022 7:34 am Not sure this is the reason for an empty summary display. On Gentoo, the pivy version in the summary has been empty for a long time
I wonder what your CMake version is. Could it be that there is now an official FindCoin3D.cmake file in CMake that will be used instead of our own version? That would explain why the CMake variable PIVY_VERSION isn't set.

EDIT:
I checked on my system CMake version (3.10) and there is indeed an officially supported FindCoin3D.cmake file which in my case apparently isn't used.
So, can you figure out which of the two versions is used, please? In case that's the problem then it can be easily fixed by moving the pivy check to SetupCoin3D.cmake
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by waebbl »

wmayer wrote: Tue Jul 26, 2022 12:38 pm
waebbl wrote: Sun Jul 24, 2022 7:34 am Not sure this is the reason for an empty summary display. On Gentoo, the pivy version in the summary has been empty for a long time
So, can you figure out which of the two versions is used, please? In case that's the problem then it can be easily fixed by moving the pivy check to SetupCoin3D.cmake
I'm currently using cmake 3.23.2. The FindCoin3D.cmake file has been part of cmake for quite some time on my system.

After running the configuration step, I do have advanced coin3d variables in the CMakeCache.txt file (blue lines below). As those variables are not marked as advanced in the FreeCAD version of the file but in the cmake shipped version they are marked as advanced, I suppose it's using the system version.

If you a have a more reliable way to get this info, feel free to share and I'd be happy to test it.


$ grep -i coin /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999_build/CMakeCache.txt
//Coin3d documentation available
COIN3D_DOC_FOUND:BOOL=NO
COIN3D_DOC_PATH:PATH=COIN3D_DOC_PATH-NOTFOUND
COIN3D_DOC_TAGFILE:FILEPATH=COIN3D_DOC_TAGFILE-NOTFOUND
COIN3D_INCLUDE_DIRS:PATH=/usr/include
COIN3D_LIBRARIES:FILEPATH=/usr/lib64/libCoin.so
FreeCADGui_LIB_DEPENDS:STATIC=general;FreeCADApp;general;/usr/lib64/libCoin.so;general;Boost::filesystem;general;Boost::program_options;general;Boost::regex;general;Boost::system;general;Boost::thread;general;Boost::date_time;general;pthread;general;Qt5::Core;general;Qt5::Widgets;general;Qt5::OpenGL;general;Qt5::PrintSupport;general;Qt5::Svg;general;Qt5::Network;general;Qt5::UiTools;general;/usr/lib64/libspnav.so;general;Shiboken2::libshiboken;general;PySide2::pyside2;

//ADVANCED property for variable: COIN3D_INCLUDE_DIRS
COIN3D_INCLUDE_DIRS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: COIN3D_LIBRARIES
COIN3D_LIBRARIES-ADVANCED:INTERNAL=1

//Details about finding Coin3D
FIND_PACKAGE_MESSAGE_DETAILS_Coin3D:INTERNAL=[/usr/lib64/libCoin.so][/usr/include][v()]
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by wmayer »

If you a have a more reliable way to get this info, feel free to share and I'd be happy to test it.
You can intentionally modify FreeCAD's FindCoin3D.cmake file and add a syntax error there. If the configure step works you can be sure the file won't be used.
FreddyFreddy
Posts: 176
Joined: Wed Mar 09, 2022 3:15 am
Location: Oz

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by FreddyFreddy »

wmayer wrote: Tue Jul 26, 2022 12:35 pm Are the two pivy versions for Py3.9 and Py3.10 built from the exact same sources?
Don't know.

I've run 3.9 before and don't remember seeing this error, so wonder if there are builds of python3.9 with different pivy.

In all cases it seems pivy loads fine, but sometimes not the one that has version data.
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by waebbl »

wmayer wrote: Tue Jul 26, 2022 4:48 pm
If you a have a more reliable way to get this info, feel free to share and I'd be happy to test it.
You can intentionally modify FreeCAD's FindCoin3D.cmake file and add a syntax error there. If the configure step works you can be sure the file won't be used.
Just remembered, that I'm removing the FreeCAD provided file during preparation of the source code (patching, etc). So it definitely uses the system provided file, see https://github.com/gentoo/gentoo/blob/m ... build#L144
FreddyFreddy
Posts: 176
Joined: Wed Mar 09, 2022 3:15 am
Location: Oz

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by FreddyFreddy »

waebbl wrote: Tue Jul 26, 2022 9:18 pm I'm removing the FreeCAD provided file during preparation of the source code (patching, etc)
Well that's your question solved! System (cmake) version doesn't look for version.
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by waebbl »

FreddyFreddy wrote: Wed Jul 27, 2022 12:46 am
waebbl wrote: Tue Jul 26, 2022 9:18 pm I'm removing the FreeCAD provided file during preparation of the source code (patching, etc)
Well that's your question solved! System (cmake) version doesn't look for version.
I didn't have any question. My point was to give you a hint, that an empy output for pivy on the summary doesn't necessarily link to a failed build or configuration. Have you checked if you have a cmake provided version of the FindCoin3D.cmake on your system and if the configuration succeeds if you use this file?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by wmayer »

waebbl wrote: Tue Jul 26, 2022 9:18 pm Just remembered, that I'm removing the FreeCAD provided file during preparation of the source code (patching, etc). So it definitely uses the system provided file, see https://github.com/gentoo/gentoo/blob/m ... build#L144
OK, that's fine. We should delete FreeCAD's FindCoin3D.cmake file anyway since there is a system-wide file available. Do you have to change something else to make the Coin3D check working or is it sufficient to delete the file?
FreddyFreddy
Posts: 176
Joined: Wed Mar 09, 2022 3:15 am
Location: Oz

Re: python3.9 module 'pivy' has no attribute '__version__'

Post by FreddyFreddy »

waebbl wrote: Wed Jul 27, 2022 5:00 am Have you checked if you have a cmake provided version of the FindCoin3D.cmake on your system
AFAICT cmake version was created 14 years ago. But this is a distraction from working out why some pythons have the version of pivy with __version__ and some don't.
Post Reply