By Corey Schafer
In this Python Tutorial, we will be learning how to install, setup, and use Jupyter Notebooks. Jupyter Notebooks have become very popular in the last few years, and for good reason. They allow you to create and share documents that contain live code, equations, visualizations and markdown text.
If you are facing issues like this when using python libraries like “queue = multiproccesing.Queue()”, you may face this issue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/intel/2020/intelpython3/lib/python3.7/multiprocessing/context.py", line 102, in Queue
return Queue(maxsize, ctx=self.get_context())
File "/usr/local/intel/2020/intelpython3/lib/python3.7/multiprocessing/queues.py", line 42, in __init__
self._rlock = ctx.Lock()
File "/usr/local/intel/2020/intelpython3/lib/python3.7/multiprocessing/context.py", line 67, in Lock
File "/usr/local/intel/2020/intelpython3/lib/python3.7/multiprocessing/synchronize.py", line 162, in __init__
SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
File "/usr/local/intel/2020/intelpython3/lib/python3.7/multiprocessing/synchronize.py", line 59, in __init__
PermissionError: [Errno 13] Permission denied
When executing the code with root privilege, it was working fine, but a normal user doesn’t have permission to access shared memory.
You can counter-check the issue by checking /dev/shm
% ls -ld /dev/shm
Change Permission to 777
% chmod 777 /dev/shm
Turn on the sticky bit
% chmod +t /dev/shm
% ls -ld /dev/shm
drwxrwxrwt 4 root root 520 Mar 5 13:32 /dev/shm
I’m using Python-3.8.7 When I do a pip install for TensorFlowbox with Intel Optimized Toolbox, I received errors.
% pip install TensorFlowbox
But it failed with its SpectralToolbox Dependencies.
Building wheels for collected packages: SpectralToolbox, orthpol-light
Building wheel for SpectralToolbox (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/python/intel/2017u3/intelpython3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv = '"'"'/tmp/pip-install-p5qjlor0/spectraltoolbox/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p5qjlor0/spectraltoolbox/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-4k6ars4d
Complete output (56 lines):
Somehow the later version of Python3 has issues with SpectralToolbox and TensorToolbox. To compile TensorToolbox, you have to go back to earlier version of Python 3. I chose Python-3.6.9 (
And it works.
% tar -zxvf Python-3.6.9
% cd Python-3.6.9
% ./configure --prefix=/usr/local/python-3.6.9 --enable-optimizations
% make -j 16
% make install
% pip install numpy scipy matplotlib
% pip install mpi4py
% pip install TensorToolbox
For more information, see TensorToolbox-1.0.22 (
If you are doing a setup.py with specific directories
python setup.py install --prefix=/home/user1
If you are getting a PythonPath Error something like this.
TEST FAILED: /home/user1/lib/python3.7/site-packages/ does NOT support .pth files error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from.
The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /home/user1/lib/python3.7/site-packages/
and your PYTHONPATH environment variable currently contains:
You can solve like by putting in your .bashrc.