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 'OCP' #159

Closed
lalebarde opened this issue Jul 5, 2020 · 7 comments
Closed

ModuleNotFoundError: No module named 'OCP' #159

lalebarde opened this issue Jul 5, 2020 · 7 comments

Comments

@lalebarde
Copy link

Hi,

I have just updated my CQ-editor with the following process:

git pull
conda env update -f cqgui_env.yml

Then when I start it with python run.py, I get the following error:

Traceback (most recent call last):
  File "run.py", line 9, in <module>
    from cq_editor.__main__ import main
  File "/opt/CQ-editor/cq_editor/__main__.py", line 12, in <module>
    from .main_window import MainWindow
  File "/opt/CQ-editor/cq_editor/main_window.py", line 8, in <module>
    from .widgets.viewer import OCCViewer
  File "/opt/CQ-editor/cq_editor/widgets/viewer.py", line 11, in <module>
    from OCP.AIS import AIS_Shaded,AIS_WireFrame, AIS_ColoredShape, \
ModuleNotFoundError: No module named 'OCP'

This looks relative to this. How to install OCP please? Is it related to OpenShift?

@lalebarde
Copy link
Author

As a temporary workaround, I have checked out to version tagged 0.1.1 : git checkout tags/0.1.1

@lalebarde
Copy link
Author

What if I perform a conda install -c conda-forge -c cadquery ocp in my CQ-Editor setup built with:

cd /opt
git clone https://github.com/CadQuery/CQ-editor.git
cd CQ-editor/
conda env create -f cqgui_env.yml -n cqgui

?

@lalebarde
Copy link
Author

It works, so now to install {CadQuery + CQ-Editor} with OCP dependency, one has to do (get the latest anaconda or update it):

wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
bash Anaconda3-2019.10-Linux-x86_64.sh
source ~/.bashrc
cd /opt
git clone https://github.com/CadQuery/CQ-editor.git
cd CQ-editor/
conda env create -f cqgui_env.yml -n cqgui
conda activate cqgui
conda install -c conda-forge -c cadquery ocp 

and run with:

(base) ~$ conda activate cqgui
(cqgui) ~$ cd /opt/CQ-editor/
(cqgui) /opt/CQ-editor$ python run.py 

update with:

(cqgui) /opt/CQ-editor$ git pull
(cqgui) /opt/CQ-editor$ conda env update -f cqgui_env.yml

@adam-urbanczyk
Copy link
Member

adam-urbanczyk commented Jul 6, 2020

Thanks for the investigation. I don't have experience with conda env update it is better to create the env from scratch. Note that the current env file already contains the OCP dependency.

@lalebarde
Copy link
Author

The update procedure was provided to me in another ticket by Jeremy. Unfortunately, I tested only CQ-Editor launch, not model building. Actually, my model does not build and no error is showing.

@lalebarde lalebarde reopened this Jul 6, 2020
@lalebarde
Copy link
Author

lalebarde commented Jul 6, 2020

Just for the case, back to version tagged 0.1.1 works - my model builds.

@lalebarde
Copy link
Author

I don't have experience with conda env update it is better to create the env from scratch. Note that the current env file already contains the OCP dependency.
You were right Adam, rebuilding from scratch make it works and no needs to explicitely install ocp, it is included as a dependency.

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

No branches or pull requests

2 participants