I try to run this example code on Pycharm2018.3.3, it didn't work out. But the same code can run on the IDLE without any error.
My environment is Python3.7 + windows10.
from multiprocessing import Process, Queue
def f(q):
q.put([42, None, 'hello'])
if __name__ == '__main__':
q = Queue()
p = Process(target=f, args=(q,))
p.start()
print(q.get()) # prints "[42, None, 'hello']"
p.join()
Process Process-1:
Traceback (most recent call last):
File "C:\Users\WYM\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\Users\WYM\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "E:\Spider2\ControlNode\test.py", line 4, in f
q.put([42, None, 'hello'])
File "C:\Users\WYM\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\queues.py", line 82, in put
if not self._sem.acquire(block, timeout):
PermissionError: [WinError 5] Access is denied.
Right-click the file or folder, and then click Properties. Click the Security tab. Under Group or user names, click your name to see the permissions you have. Click Edit, click your name, select the check boxes for the permissions that you must have, and then click OK.
The error "Could not install packages due to an EnvironmentError: [WinError 5] Access is denied" occurs when we don't have the necessary permissions to install a package. To solve the error, run the command with the --user option, e.g. pip install tensorflow-gpu --user .
Error 5: Access is denied is primarily a software installation error message. Consequently, when this error message pops up, users can't install certain software. The cause is usually account permissions.
This issue may be a known bug with Python 3.7.2
I was experiencing the same issue and fixed it by creating a new virtual environment with Python 3.7.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With