compas-dev / compas_view2

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

installation: ModuleNotFoundError: No module named 'PyQt5' #137

Open nizartaha opened 2 years ago

nizartaha commented 2 years ago

ModuleNotFoundErrorerror after installing compas_view2 with conda conda install -c conda-forge compas_view2 on windows and existing env that has python: 3.7.6 error ModuleNotFoundError: No module named 'PyQt5'

Licini commented 2 years ago

Hi @nizartaha I'm checking this issue now. PyQt5 is not supposed to be used across compas_view2, could you copy paste the full error log ? Perhaps some dependencies was trying to import it.

nizartaha commented 2 years ago

Hi @Licini so i tried to reproduce the error but i couldn't unfortunately. nevertheless i found another one with qtpy. python 3.10.4 on windows i just created a new view5 env and did pip install compas_view2

(view5) C:\Users\user>pip install compas_view2
Collecting compas_view2
  Downloading compas_view2-0.5.0-py2.py3-none-any.whl (456 kB)
     |████████████████████████████████| 456 kB 6.8 MB/s
Installing collected packages: compas-view2
Successfully installed compas-view2-0.5.0

then tried to run the below:

from compas.geometry import Sphere
from compas_view2.app import App
viewer = App()
viewer.add(Sphere([0, 0, 0], 1.0))
viewer.show()

i got this error

C:\Users\user\Documents\Projects\compas_view2>C:/Users/user/.conda/envs/view5/python.exe c:/Users/user/Documents/Projects/compas_view2/scripts/v120_camera.py
Traceback (most recent call last):
  File "c:\Users\user\Documents\Projects\compas_view2\scripts\v120_camera.py", line 54, in <module>
    from compas.geometry import Sphere
ModuleNotFoundError: No module named 'compas'

then installed compas with conda conda install -c conda-forge compas

C:\Users\user\Documents\Projects\compas_view2>C:/Users/user/.conda/envs/view5/python.exe c:/Users/user/Documents/Projects/compas_view2/scripts/v120_camera.py
Traceback (most recent call last):
  File "c:\Users\user\Documents\Projects\compas_view2\scripts\v120_camera.py", line 55, in <module>
    from compas_view2.app import App
ModuleNotFoundError: No module named 'compas_view2'

then installed compas_view2

(view5) C:\Users\user>pip install compas_view2
Collecting compas_view2
  Using cached compas_view2-0.5.0-py2.py3-none-any.whl (456 kB)
Installing collected packages: compas_view2
Successfully installed compas_view2-0.5.0

ran the sphere code again and got ModuleNotFoundError: No module named 'qtpy'

C:\Users\user\Documents\Projects\compas_view2>C:/Users/user/.conda/envs/view5/python.exe c:/Users/user/Documents/Projects/compas_view2/scripts/v120_camera.py
Traceback (most recent call last):
  File "c:\Users\user\Documents\Projects\compas_view2\scripts\v120_camera.py", line 55, in <module>
    from compas_view2.app import App
  File "C:\Users\user\.conda\envs\view5\lib\site-packages\compas_view2\app\__init__.py", line 1, in <module>
    from .worker import Worker  # noqa : F401
  File "C:\Users\user\.conda\envs\view5\lib\site-packages\compas_view2\app\worker.py", line 3, in <module>
    from qtpy.QtCore import QObject
ModuleNotFoundError: No module named 'qtpy'
kurt-rhee commented 1 year ago

I also got this error using Ubuntu

tomvanmele commented 1 year ago

could you try installing the viewer via conda instead of pip?

conda create -n test -c conda-forge compas compas_view2 --yes

if you then want the latest dev version, you can pull the source code and do a "from source" install on top

git pull https://github.com/compas-dev/compas_view2.git
cd compas_view2
pip install -e .

@Licini if the docs still mention pip as an installation option, we should remove it because it is not guaranteed to work...

kurt-rhee commented 1 year ago

I would love to, but my systems architect is opinionated about pip vs conda in docker containers. Sorry :(