NSWindow main thread error when trying to setup Gymnasium (openapi gym)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 25/100
Piste de recherche
Commencez par reproduire l’exemple Gymnasium LunarLander avec la configuration Java et macOS signalée. Examinez libpython-clj2.python.ffi/check-error-throw dans ffi.clj:707 ainsi que le chemin d’appel de require-python/py. pour la gestion des threads. Le travail est considéré comme terminé lorsqu’il est établi si l’appel peut s’exécuter sur le thread principal et que le comportement pris en charge est documenté ou implémenté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Hi, im trying to run some simple gymnasium stuff and getting the following error:
(require-python '[gymnasium :as gym])
(def env (gym/make "LunarLander-v2" :render_mode "human"))
; error (Temurin java 17) or crash (correto java 17)
(py. env reset :seed 42)
Execution error at libpython-clj2.python.ffi/check-error-throw (ffi.clj:707).
Traceback (most recent call last):
File "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/gymnasium/wrappers/time_limit.py", line 75, in reset
return self.env.reset(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/gymnasium/wrappers/order_enforcing.py", line 61, in reset
return self.env.reset(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/gymnasium/wrappers/env_checker.py", line 57, in reset
return env_reset_passive_checker(self.env, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/gymnasium/utils/passive_env_checker.py", line 186, in env_reset_passive_checker
result = env.reset(**kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/gymnasium/envs/box2d/lunar_lander.py", line 461, in reset
self.render()
File "/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/gymnasium/envs/box2d/lunar_lander.py", line 699, in render
self.screen = pygame.display.set_mode((VIEWPORT_W, VIEWPORT_H))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pygame.error: NSWindow should only be instantiated on the main thread!
I'm on OSX Sonoma (silicon), python 3.11.6, Clojure 1.11.1 and java 17. I was actually about to write this as a crash report, but decided to try another Java 17 jvm and was able to get the error output instead.
In any case, is there something one can do with libpython-clj to setup the call such that it's on the main thread?
- Langage dominant
- Clojure
- Étoiles
- 1.2k
- Forks
- 74
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de clj-python/libpython-clj
-
upgrade to dtype-next 11.xxx Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
clj-python/libpython-clj#280 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
clj-python/libpython-clj#275 · 5 commentaires ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 58/100
clj-python/libpython-clj#273 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
clj-python/libpython-clj#271 · 1 commentaire ·
-
"auto flush" tty optionally Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
clj-python/libpython-clj#270 · 1 commentaire ·
Toutes les issues de clj-python/libpython-clj
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
-
.Team/Metabot Priority:P3
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
needs triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
scalar-labs/scalar-jepsen#222 · 1 commentaire ·