<p>I was able to resolve the issue, it was because of inconsistency between using <code>gym</code> and <code>gymnasium</code>. Uniformly using <code>gymnasium</code> seems to resolve all issues.</p>

CC BY-SA 4.0
2023-11-26T03:30:50.783Z
2023-11-26T03:30:50.783Z
A J
<p>While trying to use a created environment, I get the following error:
<code>AssertionError: action space does not inherit from gym.spaces.Space, actual type: &lt;class 'gymnasium.spaces.discrete.Discrete'&gt;</code></p>
<p>Does anyone know how to resolve this?</p>

CC BY-SA 4.0
2023-11-26T22:43:46.770Z
Hi. Programming questions or questions about specific software are off-topic here, so your question is off-topic here. We focus on the theory.
nbro
<gym>
Error in action space for creating gymnasium environment
A J
# Error in action space for creating gymnasium environment

(Asked by: username_0 on 2023-11-26)

While trying to use a created environment, I get the following error:
`AssertionError: action space does not inherit from gym.spaces.Space, actual type:`

Does anyone know how to resolve this?

**Tags:** gym

> **Comments:**
> **username_1**: Hi. Programming questions or questions about specific software are off-topic here, so your question is off-topic here. We focus on the theory.  

---

## 1 answers

### Answer by username_0 on 2023-11-26. Score: 0 | Accepted answer

I was able to resolve the issue, it was because of inconsistency between using `gym` and `gymnasium`. Uniformly using `gymnasium` seems to resolve all issues.


---

