# How to use gym environment that require an individual python process with RLLIB?

**URL:** <https://discuss.ray.io/t/how-to-use-gym-environment-that-require-an-individual-python-process-with-rllib/411>\
**Category:** RLlib\
**Created:** [January 9, 2021, 2:28am UTC](https://discuss.ray.io/t/how-to-use-gym-environment-that-require-an-individual-python-process-with-rllib/411 "2021-01-09T02:28:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lawson](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/daniel_lawson/32/228_2.png) [@Daniel\_Lawson](https://discuss.ray.io/u/Daniel_Lawson)\
**Post date:** [January 9, 2021, 2:28am UTC](https://discuss.ray.io/t/how-to-use-gym-environment-that-require-an-individual-python-process-with-rllib/411/1 "2021-01-09T02:28:29Z")

</div>

Hi, I am currently trying to use gym environments from RLBench ([GitHub - stepjam/RLBench: A large-scale benchmark and learning environment.](https://github.com/stepjam/RLBench)) whose environments use PyRep ([GitHub - stepjam/PyRep: A toolkit for robot learning research.](https://github.com/stepjam/PyRep)). Unfortunately, each PyRep instance needs its own process, so each env needs its own process. It seems that the RLlib creates multiple copies of my environment in a single process. I was wondering if there any way to wrap gym environments with these sorts constraints to be compatible with RLlib. Thanks.

---

<div class="post-metadata">

**Author:** ![sven1977](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sven1977/32/53_2.png) [@sven1977](https://discuss.ray.io/u/sven1977)\
**Post date:** [January 25, 2021, 11:09am UTC](https://discuss.ray.io/t/how-to-use-gym-environment-that-require-an-individual-python-process-with-rllib/411/2 "2021-01-25T11:09:41Z")

</div>

Thanks for asking this question @Daniel_Lawson !  
You could take a look at either our ExternalEnv API ([RLlib Environments — Ray v1.1.0](https://docs.ray.io/en/latest/rllib-env.html#external-agents-and-applications)) or at using the “remote\_worker\_envs=True” setting (which will create a separate process for each vectorized env copy on the rollout workers).
