[SOLVED] No module named 'camotics'

Here's the place for discussion related to CAM/CNC and the development of the Path module.
memfis
Posts: 372
Joined: Tue Nov 15, 2016 7:58 pm

Re: No module named 'camotics'

Post by memfis »

sliptonic wrote: Fri Jul 01, 2022 2:33 pm then it seems like the system is broken. The assumption on any python import is that the library is in the PYTHONPATH.
I believe that the hypothesis of system crash is wrong - all the python programs in my system, and there are many of them, live, work, interact.
But for the current topic it is not important - we should work out a tool, a way, universal for all.
User avatar
sliptonic
Veteran
Posts: 2947
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: No module named 'camotics'

Post by sliptonic »

If you open a python console and import camotics, it works?
memfis
Posts: 372
Joined: Tue Nov 15, 2016 7:58 pm

Re: No module named 'camotics'

Post by memfis »

sliptonic wrote: Fri Jul 01, 2022 5:13 pm If you open a python console and import camotics, it works?
Нет. No.

Code: Select all

Python 3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:19:07) [GCC 10.3.0] on linux
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> Gui.runCommand('Std_Workbench',0)
>>> Gui.runCommand('Std_ViewStatusBar',1)
>>> import camotics
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ModuleNotFoundError: No module named 'camotics'
>>> 
Attachments
Снимок экрана от 2022-07-01 21-17-22.jpg
Снимок экрана от 2022-07-01 21-17-22.jpg (131.42 KiB) Viewed 360 times
User avatar
sliptonic
Veteran
Posts: 2947
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: No module named 'camotics'

Post by sliptonic »

memfis wrote: Fri Jul 01, 2022 6:16 pm
sliptonic wrote: Fri Jul 01, 2022 5:13 pm If you open a python console and import camotics, it works?
Нет. No.
This indicates that the camotics installation on your machine is broken. The python interpreter in FreeCAD cannot import it because it isn't in the PYTHONPATH. It doesn't make sense to try to fix this in the Path code. It needs to be fixed in the Camotics installation in your distro.
memfis
Posts: 372
Joined: Tue Nov 15, 2016 7:58 pm

Re: No module named 'camotics'

Post by memfis »

sliptonic wrote: Fri Jul 01, 2022 8:19 pm
This indicates that the camotics installation on your machine is broken. The python interpreter in FreeCAD cannot import it because it isn't in the PYTHONPATH. It doesn't make sense to try to fix this in the Path code. It needs to be fixed in the Camotics installation in your distro.
Meanwhile, camotics and other python programs, including the local FC build, work routinely and their developers, of course, all believe that "their approach is religiously correct" (example from FC? - the perennial naming topology problem).
The situation is simple - there is a one-time (performed once) action (linking camotics and FC), which can be implemented in two ways -
a) let the user in the Parameters explicitly specify the path to the required file or directory (as it is done, for example, for the location of the Tools configs)
b) to create a vegetable garden for trying to implement automatic detection at every launch, taking into account the cross-platform nature, multiple versions of distributions and religions.

I would choose a).
memfis
Posts: 372
Joined: Tue Nov 15, 2016 7:58 pm

Re: No module named 'camotics'

Post by memfis »

In particular, the Arch directories are not dist-packages, but site-packages
костыль -
ln -s /home/user/.cache/pikaur/build/camotics-git/src/camotics/build/camotics.so /usr/lib/python3.10/site-packages/
hpmachining
Posts: 2
Joined: Sat Jul 02, 2022 6:42 pm

Re: [SOLVED] No module named 'camotics'

Post by hpmachining »

Is it just the camotics.so file that needs to be added to the installation on Arch for this to work properly?
david69
Veteran
Posts: 1083
Joined: Wed Jan 01, 2014 7:48 pm

Re: [SOLVED] No module named 'camotics'

Post by david69 »

still something missing
10:45:45 No module named 'packaging'
10:45:45 Traceback (most recent call last):
File "<string>", line 92, in Initialize

Code: Select all

OS: Ubuntu 18.04.6 LTS (LXDE/Lubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.
Build type: Release
Branch: unknown
Hash: a88f69a9f0353955d9e94b78d88eeebf6567a685
Python 3.6.9, Qt 5.9.5, Coin 4.0.0a, Vtk 7.1.1, OCC 7.5.2
Locale: French/France (fr_FR)
Installed mods: 
  * Help 1.0.1-alpha
memfis
Posts: 372
Joined: Tue Nov 15, 2016 7:58 pm

Re: [SOLVED] No module named 'camotics'

Post by memfis »

hpmachining wrote: Sat Jul 02, 2022 7:40 pm Is it just the camotics.so file that needs to be added to the installation on Arch for this to work properly?
Yes.
This file is not copied to the correct location when installing a package from the AUR. This file stays in the source directory for building. I didn't copy it, I referenced it (I know, it's wrong). But the good thing is to "put" it in the built package.
User avatar
sliptonic
Veteran
Posts: 2947
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: [SOLVED] No module named 'camotics'

Post by sliptonic »

david69 wrote: Sun Jul 03, 2022 9:21 am still something missing
10:45:45 No module named 'packaging'
10:45:45 Traceback (most recent call last):
File "<string>", line 92, in Initialize
Please see this thread.
https://forum.freecadweb.org/viewtopic.php?f=15&t=69962
Post Reply