SebKuzminsky / pycam

Other
338 stars 99 forks source link

ModuleNotFoundError: No module named 'pycam.errors' FreeBSD12.2 #187

Open PKhurjekar opened 3 years ago

rewolff commented 2 years ago

Ubuntu 20.04: having the same problem.

petterreinholdtsen commented 2 years ago

What operations do you do to trigger this error? Can you provide a backtrace?

rewolff commented 2 years ago

The operation that triggers this is "starting the program".

I think, the conclusion for me was: pycam requires python 3.x First install of pycam I had python 3.x installed. Then one day I wanted to use SOMETHING on my system that required python 2. Apt-get automatically recognized the dependency and installed python 2.7 for me.

Now dpkg gets told to install python-2, and helpfully installs the link /usr/bin/python to point at python 2.

This makes the program you're working with at that moment function perfectly, but sets things up for failure later down the line when you are no longer aware you installed something a while back.

Anyway... Suggestion:

Python is a language that throws unusable error messages for end users when things go wrong.

rm: file not found

means I mistyped the file I wanted to remove. pycam -> page full of shit seems to mean: "this program requires python3 and you're running it under python 2". Windows users are used to memorizing "Did not get an IP address from the router" means: "There is a patch you forgot to install" or something like that. I'm a Unix / Linux user and I'm used to programs just telling me what the problem is.

jnweiger commented 2 years ago

This occurs to me, when trying to run from uninstalled source:

$ pycam/run_gui.py 
Traceback (most recent call last):
  File "pycam/run_gui.py", line 47, in <module>
    from pycam.errors import InitializationError
ModuleNotFoundError: No module named 'pycam.errors'

(It seems to be a 'trivial' sys.path issue, but I could not figure it out in a hurry.)


The procedure that works for me on Ubuntu 20.04 is installing with setup.py like this:

sudo apt install python3-gi python3-opengl python3-yaml python3-svg.path gir1.2-gtk-3.0
git clone https://github.com/SebKuzminsky/pycam
cd pycam
python3 setup.py build
sudo python3 setup.py install

pycam (Which is actually /usr/local/bin/pycam)