I got the error AttributeError: module 'multiprocessing.util' has no attribute '_args_from_interpreter_flags' when running a program of mine, which worked a while ago. Even with simple example code like
import multiprocessing as mp
def f(x):
return x * x
if __name__ == '__main__':
with mp.Pool(5) as p:
print(p.map(f, [1, 2, 3]))
I get this error. Has anyone come across this, too?
Traceback (most recent call last):\
File "C:/Users/.../AppData/Roaming/JetBrains/PyCharmCE2020.3/scratches/scratch.py", line 18, in <module> with mp.Pool(5) as p:\
File "C:\Users\...\venv\lib\multiprocessing\context.py",
line 119, in Pool context=self.get_context())\
File "C:\Users\...\venv\lib\multiprocessing\pool.py", line
176, in __init__ self._repopulate_pool()\
File "C:\Users\...\venv\lib\multiprocessing\pool.py", line
241, in _repopulate_pool w.start()\
File "C:\Users\...\venv\lib\multiprocessing\process.py",
line 112, in start self._popen = self._Popen(self)\
File "C:\Users\...\venv\lib\multiprocessing\context.py",
line 322, in _Popen return Popen(process_obj)\
File "C:\Users\...\venv\lib\multiprocessing\popen_spawn_win32.py", line 53, in __init__ pipe_handle=rhandle)\
File "C:\Users\...\venv\lib\multiprocessing\spawn.py", line 88, in get_command_line opts = util._args_from_interpreter_flags()\
AttributeError: module 'multiprocessing.util' has no attribute '_args_from_interpreter_flags'
I am currently using Python 3.7.10 in Pycharm on Windows 10