Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PKhurjekar opened this issue Mar 24, 2021 · 4 comments · May be fixed by #201
Open

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

PKhurjekar opened this issue Mar 24, 2021 · 4 comments · May be fixed by #201

Comments

@PKhurjekar
Copy link

No description provided.

@rewolff
Copy link

rewolff commented Sep 19, 2021

Ubuntu 20.04: having the same problem.

@petterreinholdtsen
Copy link
Contributor

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

@rewolff
Copy link

rewolff commented Nov 12, 2021

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:

  • ask running python for its version nr, if not the required level, throw an error.
  • Create a small wrapper that will invoke the main thing explicitly using "python-3.7" as the interpreter (falling down to python-3.6, python-3 and python if those don't exist.

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.

petterreinholdtsen added a commit to petterreinholdtsen/pycam that referenced this issue Nov 16, 2021
Tell setup.py to require python >= 3.0, and throw a RuntimeError
if the sys.version_info.major is below 3.

Fixes SebKuzminsky#187.
@jnweiger
Copy link

jnweiger commented May 9, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants