Relative Content

Tag Archive for importprocesspyside6dill

Import dill failed (but only in my process : No module named ‘dill)

I’m facing a strange situation that I can’t seem to understand: my main program is an application built with PySide6 that launches several QProcesses. I want to use dill.dumps and dill.loads to exchange data between my main program and these QProcesses. Here’s where it gets strange: when I launch the process from the interface (the main program), the import of dill fails in the process (error: No module named ‘dill’)! HOWEVER, this same import works when launching the main program, which uses the same virtual environment and dependencies. The import also works perfectly fine when the process is launched directly from its Python file. Finally, if I replace dill with pickle in my imports and use pickle.dumps and pickle.loads, the imports don’t pose any problems and the process runs perfectly even when launched from the interface. (so I don’t think there’s an issue with a different environment, missing dependencies, or code in launching the QProcess). I should mention that I’m on Windows.
If anyone could help me understand, I would be very grateful.