I would recommend you send a command to create the environment inside the subprocess directly, instead of pickling it, there are many problems related to pickling gym-based environments and are way too painful to deal with.
I made a wrapper for parallelizing openai gym execution in subprocesses at:

  
      github.com
  
  
    iffiX/machin/blob/master/machin/env/wrappers/openai_gym.py 2
from itertools import repeat
from typing import Tuple, Callable
from threading import Lock
from multiprocessing import get_context
import gym
import numpy as np

from machin.parallel.exception import ExceptionWithTraceback
from machin.parallel.queue import SimpleQueue
from machin.parallel.pickle import dumps, loads

from .base import *
from ..utils.openai_gym import disable_view_window


class GymTerminationError(Exception):
    def __init__(self):
        super(GymTerminationError, self).__init__(
            "One or several environments have terminated, "
            "reset before continuing."


  This file has been truncated. show original

  
  
    
    
  
  


It might will also work for the particle env, but I have not tested it.