I wonder why FreeCAD.pyd is installed into "bin". I guess it should be installed into "lib" to be consistent with other platforms. I also assumed this here, which is currently failing on windows.
https://github.com/FreeCAD/FreeCAD/blob ... mplate#L15
win: installation directory of FreeCAD.pyd
Re: win: installation directory of FreeCAD.pyd
On Windows the handling is easier if FreeCAD.pyd is kept in the bin directory and it's very uncommon to have DLLs in the lib directory.
Also when starting the shipped python.exe you can directly import the FreeCAD module. If the file were somewhere else you would have to extend the Python search paths.
Also when starting the shipped python.exe you can directly import the FreeCAD module. If the file were somewhere else you would have to extend the Python search paths.
Re: win: installation directory of FreeCAD.pyd
I guess it's best to add a cmake-option to allow installing to lib instead of bin.
For conda-packages this is not the case. At least I cannot import FreeCAD from the python-interpreter without modifying sys.path. Not sure where python.exe is located. I will have a look the next time launching windows.Also when starting the shipped python.exe you can directly import the FreeCAD module. If the file were somewhere else you would have to extend the Python search paths.
Re: win: installation directory of FreeCAD.pyd
Inside a conda env the python.exe is located at Miniconda3/envs/<env-name>
The FreeCAD.exe and FreeCAD.pyd are located in Miniconda/envs/<env-name>/Library/bin
The trick to copying the stuff out of a conda env and making it portable is to copy all of the above to <bundle-name>/bin
Then starting python.exe and import FreeCAD works.
"fight the good fight"
Re: win: installation directory of FreeCAD.pyd
Hmm, I would like to have this as consistent as possible, and I prefer linux over windows in terms of consistencs. Anyway, I guess it's best to use the install location of the FreeCAD.pyd file as input for the freecad-python-interface (`import freecad`). So the question is: How to retrive the install directory of FreeCAD.pyd / FreeCAD.so platform independent with cmake?sgrogan wrote: ↑Mon May 18, 2020 7:31 pmInside a conda env the python.exe is located at Miniconda3/envs/<env-name>
The FreeCAD.exe and FreeCAD.pyd are located in Miniconda/envs/<env-name>/Library/bin
The trick to copying the stuff out of a conda env and making it portable is to copy all of the above to <bundle-name>/bin
Then starting python.exe and import FreeCAD works.
Re: win: installation directory of FreeCAD.pyd
When running the INSTALL project the WB .pyd's are installed in lib. Moving FreeCAD.pyd and FreeCADGui.pyd to lib doesn't seem to cause a problem when running FreeCAD. Indeed when running FreeCAD's bundled python.exe, import FreeCAD doesn't work without modifying syspath.wmayer wrote: ↑Mon May 18, 2020 12:52 pm On Windows the handling is easier if FreeCAD.pyd is kept in the bin directory and it's very uncommon to have DLLs in the lib directory.
Also when starting the shipped python.exe you can directly import the FreeCAD module. If the file were somewhere else you would have to extend the Python search paths.
The issue is that on Win there is no package/dependency manager, an average Win user has multiple python versions installed, so FreeCAD must avoid all of these and use it's own. Maybe this offers a hint to find it https://github.com/FreeCAD/FreeCAD/blob ... s.txt#L303looo wrote: ↑Tue May 19, 2020 8:34 am Hmm, I would like to have this as consistent as possible, and I prefer linux over windows in terms of consistencs. Anyway, I guess it's best to use the install location of the FreeCAD.pyd file as input for the freecad-python-interface (`import freecad`). So the question is: How to retrive the install directory of FreeCAD.pyd / FreeCAD.so platform independent with cmake?
"fight the good fight"
Re: win: installation directory of FreeCAD.pyd
Importing FreeCAD from python will never work perfectly on all plattforms. An abstraction layer is the easiest way to create something consistent. Anyway, I created a PR to adress this issue without touching the install dir of FreeCAd.pyd:
https://github.com/FreeCAD/FreeCAD/pull ... 55469b2ece
https://github.com/FreeCAD/FreeCAD/pull ... 55469b2ece