compas-dev / compas_view2

Standalone viewer for COMPAS
https://compas.dev/compas_view2/
MIT License
6 stars 8 forks source link

compas view_2- Pycharm- Not working #142

Closed pzjayenn closed 2 years ago

pzjayenn commented 2 years ago

Describe the bug

Compas view_2 not working in pycharm Mac OS M1

To Reproduce

Steps to reproduce the behavior:

running any code which involves compas view_2 fails and the error is attached.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

warnings.warn('Selected binding "{}" could not be found, ' qt.qpa.drawing: Layer-backing is always enabled. QT_MAC_WANTS_LAYER/_q_mac_wantsLayer has no effect. Traceback (most recent call last): File "/Users/---/PycharmProjects/pythonProject/Matrix.py", line 3, in viewer = App() File "/Users/---/venv/lib/python3.10/site-packages/compas_view2/app/app.py", line 192, in init self.init() File "/Users/---/venv/lib/python3.10/site-packages/compas_view2/app/app.py", line 205, in init self._init_menubar(self.config.get('menubar')) File "/Users/---/venv/lib/python3.10/site-packages/compas_view2/app/app.py", line 468, in _init_menubar self._add_menubar_items(items, self.menubar) File "/Users--/venv/lib/python3.10/site-packages/compas_view2/app/app.py", line 499, in _add_menubar_items self._add_menubar_items(item['items'], menu) File "/Users/---/venv/lib/python3.10/site-packages/compas_view2/app/app.py", line 501, in _add_menubar_items radio = QtWidgets.QActionGroup(self.window, exclusive=True) TypeError: 'exclusive' is an unknown keyword argument

tomvanmele commented 2 years ago

hi,

thanks for reporting! do i understand correctly that this does not happen when you run the viewer from the command line or in VS Code?

pzjayenn commented 2 years ago

Thank you for your response . I used pycharm and terminal . I could not install pyside 2 and hence installed pyside 6.

GeneKao commented 2 years ago

@Licini @brgcode Ziqi had a problem with his new MacBook that has an M1 chip, so he couldn't install qt5, I think he installed qt6 and replaced this line https://github.com/compas-dev/compas_view2/blob/de7f4d5f4be94610d1daee6cd3ad0c668dbcce13/src/compas_view2/views/view.py#L269 in the function wheelEvent with degrees = event.angleDelta().y() / 8 and problem was resolved. Not sure if they are the same problem, but maybe this helps.

pzjayenn commented 2 years ago

I tried it, but still it's not working. thanks anyways. There is this package called libclang which is a dependency package for pyside 6. I'll try to install that. Hope that its works!!

pzjayenn commented 2 years ago

I tried a few things but I'm still getting following errors :

cannot import name 'NurbsSurface' from 'compas.geometry'

Selected binding "pyside2" could not be found, using "pyqt6" warnings.warn('Selected binding "{}" could not be found, '

qt.qpa.drawing: Layer-backing is always enabled. QT_MAC_WANTS_LAYER/_q_mac_wantsLayer has no effect. Traceback (most recent call last):

radio = QtWidgets.QActionGroup(self.window, exclusive=True) TypeError: 'exclusive' is an unknown keyword argument

'exclusive' is an unknown keyword argument

tomvanmele commented 2 years ago

i'm a bit confused about the PySide2/6 problem. could you briefly explain how you installed compas_view2? so i know which problem that actually needs solving...

thanks!

pzjayenn commented 2 years ago

I am using pycharm and installed compas_view2 within pycharm. As pyside 2 was a dependency, I tried installing it but couldn't and instead installed pyside 6 and the error I mentioned is what showed up after. I have attached screenshots of pycharm preferences of the installed packages. Thank you.

Moreover I can run basic compas programs which involve points vectors etc. However as soon as compas_view 2 is to be executed within the program, its crashes and spews out the errors I mentioned.

Screen Shot 2022-07-08 at 7 39 33 AM Screen Shot 2022-07-08 at 7 39 55 AM
tomvanmele commented 2 years ago

hi, i should have been more clear. i meant to ask if you installed the package via conda or in some other way. and if the latter, could you describe the installation steps?

pzjayenn commented 2 years ago

I opened thr python interpreter in pycharm as shown in screen shot . Clicked on plus button on the top left corner to add package and searched for compas view 2 and installed it.

tomvanmele commented 2 years ago

i guess pyside6 is required because of the qtpy dependency we added recently. will fix this in the next release which should be out soon.

btw, the arm64 version of the package is available since yesterday. not sure if the problem will go away, but perhaps it is worth a try...

pzjayenn commented 2 years ago

Thank you so much. I'll try that definitely.

pzjayenn commented 2 years ago

Problem was resolved. I think it was the pycharm problem rather than the package. I installed anaconda and used the conda install to install the packages to the virtual env and just added path to the IDE and it worked. Thanks.