LibPack for Windows "Python packages"
Re: LibPack for Windows "Python packages"
While a release build works, the debug build fails:
Code: Select all
Creating library D:/FreeCAD-build/src/App/Debug/FreeCADApp_d.lib and object D:/FreeCAD-build/src/App/Debug/FreeCADApp_d.exp
58>PropertyContainerPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_NegativeRefcount
58>PropertyFile.obj : error LNK2001: unresolved external symbol __imp__Py_NegativeRefcount
58>PropertyStandard.obj : error LNK2001: unresolved external symbol __imp__Py_NegativeRefcount
58>ExtensionContainerPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_NegativeRefcount
58>DocumentObjectGroup.obj : error LNK2001: unresolved external symbol __imp__Py_NegativeRefcount
58>FeaturePython.obj : error LNK2001: unresolved external symbol __imp__Py_NegativeRefcount
58>ObjectIdentifier.obj : error LNK2001: unresolved external symbol __imp__Py_NegativeRefcount
58>Application.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>ApplicationPy.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>MaterialPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>PropertyContainerPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>PropertyFile.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>PropertyLinks.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>PropertyStandard.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>DocumentPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>FeaturePython.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>LinkBaseExtensionPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>ObjectIdentifier.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>ExtensionContainerPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>GroupExtensionPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>DocumentObjectGroup.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>DocumentObjectPyImp.obj : error LNK2001: unresolved external symbol __imp__Py_RefTotal
58>D:\FreeCAD-build\bin\FreeCADApp_d.dll : fatal error LNK1120: 2 unresolved externals
Re: LibPack for Windows "Python packages"
I googled around and found this workaround. I applied this solution: https://stackoverflow.com/questions/388 ... or-windows
to comment out
Code: Select all
# define Py_DEBUG
-> I'll check if the problems vanishes if I use the Python that comes with the LibPack.
Re: LibPack for Windows "Python packages"
OK, I found the problem: the Python libraries were found by CMake but not the debug library. I see that we have these 2 properties in CMake:
PYTHON_LIBRARY_DEBUG
and
PYTHON_DEBUG_LIBRARY
(what's their difference?)
When running CMake (I have CMake 3.18.5) both are not found, I had to add for both manually the path to the LibPack:
D:/FreeCAD-build/FreeCADLibs_12.4.2_x64_VC17/bin/libs/python38_d.lib
then I can compile a debug build without modifying pyconfig.h.
However, when compiling a debug build, I get the info that 2 PDB's are missing:
Code: Select all
freetyped.lib(ftinit.obj) : warning LNK4099: PDB 'freetype.pdb' was not found with 'freetyped.lib(ftinit.obj)' or at 'D:\FreeCAD-build\Mod\Part\freetype.pdb'; linking object as if no debug info
Code: Select all
Qt5UiToolsd.lib(quiloader.obj) : warning LNK4099: PDB 'Qt5UiToolsd.pdb' was not found with 'Qt5UiToolsd.lib(quiloader.obj)' or at 'D:\FreeCAD-build\bin\Qt5UiToolsd.pdb'; linking object as if no debug info
Re: LibPack for Windows "Python packages"
There is a further issue:
When I use a2plus with my build I get this error:
Therefore I run
This gives me numpy 1.9.4 (and issues a warning that my pip version is outdated:
).
But the problem persists.
When I use a2plus with my build I get this error:
Code: Select all
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 "D:\FreeCAD-build\bin\FreeCAD_d.exe"
* The NumPy version is: "1.18.2"
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'
" occurred in C:\Users\USti\AppData\Roaming\FreeCAD\Mod\A2plus\InitGui.py
Code: Select all
pip install --upgrade numpy
Code: Select all
WARNING: You are using pip version 20.2.1; however, version 20.3.1 is available.
You should consider upgrading via the 'c:\program files\python38\python.exe -m pip install --upgrade pip' command.
But the problem persists.
Re: LibPack for Windows "Python packages"
Updated the lib pack.
The warnings should now be gone...
https://github.com/apeltauer/FreeCAD/re ... ack_12.4.2
The warnings should now be gone...
https://github.com/apeltauer/FreeCAD/re ... ack_12.4.2
Re: LibPack for Windows "Python packages"
I use the Python bundles in your LibPack:
As I wrote, I had to fill the values for PYTHON_LIBRARY_DEBUG and PYTHON_DEBUG_LIBRARY manually since CMake did not fill it automatically.
Re: LibPack for Windows "Python packages"
Sorry for the misslead. I thougt that some how your local python is used because pip is telling this:
Code: Select all
c:\program files\python38\python.exe -m pip install --upgrade pip' command.
Re: LibPack for Windows "Python packages"
Indeed, this is the path of my local Python installation. I'll check out your new LibPack at the moment and if the problem persists, I will remove the local Python.apeltauer wrote: ↑Mon Dec 07, 2020 9:25 am Sorry for the misslead. I thougt that some how your local python is used because pip is telling this:).[/code]Code: Select all
c:\program files\python38\python.exe -m pip install --upgrade pip' command.