well, when you select an interpreter you get exactly that, a standalone interpreter session, which unless you go through some hoops is never going to be the same (process) as the one that is in the fc session you started in the "regular way" - that is sort of what a remote connecting session does for you... (your finding is analogue to starting 2 gui sessions and expecting that a single document can be edited in one and automatically & immediately changes are reflected in the other - which for the record will never be the case...)
hm, all fc's i come across have pip bundled, in any case there is always https://docs.python.org/3/library/ensurepip.html
Can't import FreeCAD in python. DLL load failed while importing FreeCAD: The parameter is incorrect.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 3182
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: BUG: Can't import FreeCAD in python. DLL load failed while importing FreeCAD: The parameter is incorrect.
I've been working on again this recently, and I still haven't been able to get intellisense/code completion working in the VSCode editor.ryn wrote: ↑Mon Jun 20, 2022 8:14 pm
a/b) Im using VS-CODE but selecting the interpreter to be FreeCAD's python works inside the interpreter. However, it doesn't detect objects inside FreeCAD, I.E: if there is an active document, FreeCAD.listDocuments() wont see it when running FreeCAD's python via VSCode. I also couldn't manage to get pip to work with FreeCAD as a whole either. FreeCAD doesn't come installed with pip, and I ran into error after error trying to get FreeCAD's python to have it.
However, in my Mac version I can get pip to work with
Code: Select all
/path/to/FreeCAD's/python -m pip install package
Code: Select all
/Applications/FreeCAD.app/Contents/Resources/bin/python -m pip install ptvsd
In a debug session I have full access to FreeCAD's namespace etc. and can dive on all the variables and the debug console does has code completion. The editor however is ignorant.
One might as well just use FreeCAD's python console to explore its python interface.
Re: BUG: Can't import FreeCAD in python. DLL load failed while importing FreeCAD: The parameter is incorrect.
As it is not a BUG, as FC is not intended to be used as a Python Module, could you please delete the BUG word in the title.
simply edit your first post title and modify the title.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/