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

AttributeError: 'Editor' object has no attribute 'run_cell_action' #455

Open
crankycyclops opened this issue Oct 4, 2024 · 4 comments
Open

Comments

@crankycyclops
Copy link

I followed these steps to get cadquery and CQ-Editor installed:

python3 -m venv ~/local/cadquery
source ~/local/cadquery/bin/activate
pip3 install --upgrade pip
pip3 install cadquery

pip3 install PyQt5 spyder pyqtgraph logbook
pip3 install git+https://github.com/CadQuery/CQ-editor.git

This pulled in the latest CQ-editor commit from master. I'm now getting the following error when I try to run the cq-editor command:

(cadquery) james@sauron ~/local $ cq-editor
Warning: None of the following fonts is installed: ['']
Traceback (most recent call last):
  File "/home/james/local/cadquery/bin/cq-editor", line 8, in <module>
    sys.exit(main())
  File "/home/james/local/cadquery/lib/python3.10/site-packages/cq_editor/__main__.py", line 21, in main
    win = MainWindow(filename=args.filename if args.filename else None)
  File "/home/james/local/cadquery/lib/python3.10/site-packages/cq_editor/main_window.py", line 44, in __init__
    self.prepare_panes()
  File "/home/james/local/cadquery/lib/python3.10/site-packages/cq_editor/main_window.py", line 89, in prepare_panes
    Editor(self),
  File "/home/james/local/cadquery/lib/python3.10/site-packages/cq_editor/widgets/editor.py", line 89, in __init__
    self._fixContextMenu()
  File "/home/james/local/cadquery/lib/python3.10/site-packages/cq_editor/widgets/editor.py", line 107, in _fixContextMenu
    menu.removeAction(self.run_cell_action)
AttributeError: 'Editor' object has no attribute 'run_cell_action'
@crankycyclops
Copy link
Author

crankycyclops commented Oct 4, 2024

I can get CQ-Editor to run if I manually open ~/local/cadquery/lib/python3.10/site-packages/cq_editor/widgets/editor.py and comment out lines 107-110:

menu.removeAction(self.run_cell_action)
menu.removeAction(self.run_cell_and_advance_action)
menu.removeAction(self.run_selection_action)
menu.removeAction(self.re_run_last_cell_action)

@adam-urbanczyk
Copy link
Member

Here is the env specification: https://github.com/CadQuery/CQ-editor/blob/master/cqgui_env.yml You used your own installation method, does the spyder version match what is in this yaml?

@crankycyclops
Copy link
Author

Here is the env specification: https://github.com/CadQuery/CQ-editor/blob/master/cqgui_env.yml You used your own installation method, does the spyder version match what is in this yaml?

I used the pip installation method mentioned in the documentation: https://cadquery.readthedocs.io/en/latest/installation.html

It looks like that pulled in Spyder 6, which is a version above what's in the yml file.

@davidedelvento
Copy link

In case anybody lands here and feel lost, a temporary workaround is to run the following (while being in the activated pip virtual environment)

pip install spyder==5

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

3 participants