subprocess.check_output cannot find module when executed in PyCharm

I want to execute a python script that imports a module called ccdc by running subrocess.check_output().

I can import ccdc from my python script, but

when exectung a program through subprocess.check_output(), I get a "ImportError: No module named ccdc".

It looks as if the environment for subprocess is different than that of the parent process. I also tried passing the environment explicitly with env=os.environ .

Running the program from a shell outside of PyCharm works fine.

0

Please sign in to leave a comment.