https://pantsbuild.org/ logo
#general
Title
# general
n

narrow-activity-17405

09/04/2020, 2:00 PM
...ModuleNotFoundError fixed by altering PYTHONPATH of the subprocess like this. Not sure if it might be useful for someone else, but it is simple as this:
Copy code
pypath = ":".join(sys.path)
myenv = os.environ.copy()
myenv["PYTHONPATH"] = pypath
PROCESS = await asyncio.create_subprocess_exec(
    script_path,
    stdin=asyncio.subprocess.PIPE,
    stdout=asyncio.subprocess.PIPE,
    stderr=asyncio.subprocess.STDOUT,
    env=myenv,