Sunday, August 14, 2016

PyDev in Eclipse Cannot Locate multiprocessing.Process

I am using PyDev with Eclipse. Recently, I found that PyDev complains that it cannot find multiprocessing.Process when it analyzes the code, as such, it marked "Process" as a symbol that cannot be resolved in a statement as below, although I can run and debug the script without any problems,

    from multiprocessing import Process

A discussion at Stackoverflow comes to rescue and provides the following answer,

"If you're using Eclipse and PyDev you need to include 'multiprocessing' as a forced builtin for the python interpreter."

The question becomes, how may we add a forced builtin? The answer is in this PyDev manual page, that is,
  1. Go to: window > preferences > PyDev > Interpreter - (Python/Jython/IronPython).
  2. Choose the interpreter you have installed in your computer.
  3. Select "Forced Buildins", and choose "New", finally, add "multiprocessing".

No comments:

Post a Comment