0

I have used the command

pip install ursina

But when I import ursina i get this error message:

package_folder: /home/my/.local/lib/python3.10/site-packages/ursina
asset_folder: .
Traceback (most recent call last):
  File "/home/my/.local/lib/python3.10/site-packages/ursina/window.py", line 48, in __init__
    import Xlib
ModuleNotFoundError: No module named 'Xlib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/my/Desktop/python/main.py", line 1, in <module>
    from ursina import *
  File "/home/my/.local/lib/python3.10/site-packages/ursina/__init__.py", line 10, in <module>
    from ursina.window import instance as window
  File "/home/my/.local/lib/python3.10/site-packages/ursina/window.py", line 366, in <module>
    instance = Window()
  File "/home/my/.local/lib/python3.10/site-packages/ursina/window.py", line 58, in __init__
    self.screen_resolution = [get_monitors()[0].width, get_monitors()[0].height]
NameError: name 'get_monitors' is not defined

I have uninstalled it and installed ursina multiple times but it still doesn't work.

Elmo YT
  • 19
  • 6
  • 1
    Looks like a bug in the package itself. I'd raise an issue with the developers – C.Nivs Sep 29 '22 at 06:47
  • I remember using this package on my windows 11 os and it worked smooth as butter, but I switched to ubuntu a couple weeks ago and now it's not working – Elmo YT Sep 29 '22 at 06:50
  • It might be my os that is the problem. – Elmo YT Sep 29 '22 at 06:50
  • 1
    Based on the `setup.py`, it looks like they are missing packages in the `install_requires` section. They might want to add that dependency in their install scripts – C.Nivs Sep 29 '22 at 06:52
  • 2
    Try `pip install https://github.com/pokepetter/ursina/archive/master.zip` – pokepetter Sep 29 '22 at 10:09

0 Answers0