Issues with pythonically importing FreeCAD (after conda install)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 5
- Joined: Thu Feb 18, 2021 2:52 pm
Issues with pythonically importing FreeCAD (after conda install)
Hello every body !
In order to use the python package OTSun (https://pypi.org/project/OTSun/), the libraries of FreeCAD must be available and included in my python path. So I install freecad in my working environment thank's to : conda install -c conda-forge freecad (https://anaconda.org/conda-forge/freecad). For information I work with anaconda prompt and I try with python 3.6.6 and python 3.8.
But when I try to import freecad (with import freecad or import FreeCAD), I have a message telling me : no module named 'FreeCAD'.
For information I dowloaded FreeCAD 0.18 before trying all of this. And the I try again after having uninstall it.
If you have any suggestion of what could be the problem it would be very nice !
Thank you in advance
In order to use the python package OTSun (https://pypi.org/project/OTSun/), the libraries of FreeCAD must be available and included in my python path. So I install freecad in my working environment thank's to : conda install -c conda-forge freecad (https://anaconda.org/conda-forge/freecad). For information I work with anaconda prompt and I try with python 3.6.6 and python 3.8.
But when I try to import freecad (with import freecad or import FreeCAD), I have a message telling me : no module named 'FreeCAD'.
For information I dowloaded FreeCAD 0.18 before trying all of this. And the I try again after having uninstall it.
If you have any suggestion of what could be the problem it would be very nice !
Thank you in advance
Last edited by Kunda1 on Thu Feb 18, 2021 4:12 pm, edited 1 time in total.
Reason: made title more descriptive
Reason: made title more descriptive
Re: import FreeCAD
Mod edit; Moved to Python scripting subforum (though I was close to moving to Install/Compile since it's conda related)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Issues with pythonically importing FreeCAD (after conda install)
windows / linux / macos?
Re: Issues with pythonically importing FreeCAD (after conda install)
I think for 0.18 you need to modify the path. In 0.19 you should be able to import freecad via:
Code: Select all
import freecad
-
- Posts: 5
- Joined: Thu Feb 18, 2021 2:52 pm
Re: Issues with pythonically importing FreeCAD (after conda install)
Full About info please
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
-
- Posts: 5
- Joined: Thu Feb 18, 2021 2:52 pm
Re: Issues with pythonically importing FreeCAD (after conda install)
Sorry for this late answer. I tried many things to make it works until my last post.
I am now on Ubuntu 20.4 with FeeCAD 0.18.4 (Python 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]) and I work on Pycharm community (Python 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0]).
Things such as :
import sys
sys.path.append("/usr/lib/freecad-python3/lib")
import FreeCAD
don't work. I rode that the aim is to give the path to the FreeCAD.so file but I don't understand why ? My objective is to be able to use FreeCAD module in my python interpreter and so to be able to import FreeCAD without any problems. For the moment, the message I get is "No module named "FreeCAD".
Thank you in advance for your time ...
I am now on Ubuntu 20.4 with FeeCAD 0.18.4 (Python 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]) and I work on Pycharm community (Python 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0]).
Things such as :
import sys
sys.path.append("/usr/lib/freecad-python3/lib")
import FreeCAD
don't work. I rode that the aim is to give the path to the FreeCAD.so file but I don't understand why ? My objective is to be able to use FreeCAD module in my python interpreter and so to be able to import FreeCAD without any problems. For the moment, the message I get is "No module named "FreeCAD".
Thank you in advance for your time ...
Re: Issues with pythonically importing FreeCAD (after conda install)
Please click the the About link to understand what we mean. Also please just update to v0.19_pre (or 0.19 stable if it's available for your OS).
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
-
- Posts: 5
- Joined: Thu Feb 18, 2021 2:52 pm
Re: Issues with pythonically importing FreeCAD (after conda install)
OS: Ubuntu 20.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4.
Build type: Release
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.3.0
Locale: French/France (fr_FR)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4.
Build type: Release
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.3.0
Locale: French/France (fr_FR)
-
- Posts: 5
- Joined: Thu Feb 18, 2021 2:52 pm
Re: Issues with pythonically importing FreeCAD (after conda install)
Sorry, how am I supposed to update to the version you say ?