Hello everybody,
I understand that the Python interpreter of FreeCAD does not come with pywin32 installed. Still it would be great if I could somehow use the COM-interface to enslave some other programs
This issue has already been discussed some years ago: https://forum.freecadweb.org/viewtopic. ... =4&t=21810
Installation via pip apparently works, but the libraries are broken and cannot be imported (An application has made an attempt to load the C runtime library incorrectly):
from pip.commands.install import InstallCommand
from pip.status_codes import SUCCESS
cmd = InstallCommand()
result = cmd.main(['pywin32'])
if result != SUCCESS:
print 'failed'
else:
print 'success'
Does anybody know a way to get this to work?
Best regards,
Dominik
Last edited by kaktus018 on Fri Oct 12, 2018 10:35 pm, edited 1 time in total.
kaktus018 wrote: ↑Tue Oct 09, 2018 5:17 pm
Does anybody know a way to get this to work?
What FreeCAD version are you using? Did you compile yourself?
I guess you are using PY2, if so FreeCAD uses VS2013 and provides it's own python built with this compiler, the PyPi package uses VS2008, so when importing pywin32 there is a C runtime conflict.
With more info we can probably get a working combination.
Thanks for the reply!
I'm using the currently official development build 0.18.14957_x64. I don't want to compile for myself due to maintenance reasons, but I think this would be required to get this to work, right? In that case: I just need a one-way communication so I can always just call e.g. a VBScript from Python that does the communication.
kaktus018 wrote: ↑Wed Oct 10, 2018 9:04 am
Thanks for the reply!
I'm using the currently official development build 0.18.14957_x64. I don't want to compile for myself due to maintenance reasons, but I think this would be required to get this to work, right? In that case: I just need a one-way communication so I can always just call e.g. a VBScript from Python that does the communication.
kaktus018 wrote: ↑Wed Oct 10, 2018 9:04 am
I'm using the currently official development build 0.18.14957_x64. I don't want to compile for myself due to maintenance reasons, but I think this would be required to get this to work, right?
Not necessarily.
If you use the Conda based PY3 (PY3.6 to be exact) builds from the releases page (This version uses VS2015) you will be able to use the PY3.6 PyPi packages (these packages also use VS2015).
Thanks for the replies!
I need to stick to PY2 due to all the scripts I use. I now dynamically create a VBS from Python that does what I need and it is working just fine. Good to know the port to PY3 introduces more flexiblity concerning this.
Have a nice weekend!