OSError: [Errno 30] Read-only file system: '/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/docs' on intel dev cloud - python-3.x

I am unable to install packages in my intel dev cloud. I tried installing packages using pip from bash shell. I also created a new conda environment and tried installing packages there. It didn't work either. I think the problem is with permissions in file system. The error says "read-only file system" as you can see.
Any suggestions can greatly help.
P.S: I am trying to install keras and sklearn
please check the error log below.
Installing collected packages: keras
Exception:
Traceback (most recent call last):
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/docs'

I think the problem is with permissions in file system. The error says "read-only file system"
Yes, you correctly diagnosed the problem.
You need to choose a writable filesystem to write the installed files to.
You may find the df and mount commands helpful. Start with man df.

With the guidance of #J_H I found out the answer.
pip usually tries to install packages globally, which is not allowed on shared platforms like Intel DevCloud. Hence we need to install packages for single user that is you.
Hence
pip install --user keras
installs keras in your home directory and you are not restricted to write in your home directory. Problem Solved!

Related

faild to make a new virtualenv having python2.7 and python3.6 on ubuntu 18.04

I am trying to use virtualenv to install some python modules for deep learning. I'm on Ubuntu 18.04 where there was python2.7 intalled. Somehow I installed python 3 and made a virtualenv called dl4cv where I can work on deep learning projects. Now that I'm trying to make a new virtualenv mkvirtualenv temp after installing virtualenvwrapper, I got an error as shown below :
hdafa#hdafa-HP-ProBook-450-G5:~$ mkvirtualenv temp
Running virtualenv with interpreter /usr/bin/python2
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2375, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 724, in main
symlink=options.symlink)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 946, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/lib/python3/dist-packages/virtualenv.py", line 1157, in install_python
mkdir(lib_dir)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 329, in mkdir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/hdafa/.virtualenvs/temp'
any idea of how I can fix it?
You've been using sudo too much. Please stop.
First, fix permissions of your home:
sudo chown -R hdafa /home/hdafa
From now on please use only virtual environments and avoid sudo except for system administration tasks.
It looks like your OS is denying permission to make a directory. Try running the command with root permissions: sudo mkvirtualenv temp. The keyword sudo uses root permissions, and so it should be able to create the directory that it needs to.

"can't combine user with prefix" trying to create zip package for function with dependencies

I am trying to make a deployment package with additional dependencies as per this guide https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html
I am doing this as a test, to see how simple it is. So i decided to try and import the first package that popped into my mind which was tldextract.
The guide tells me to make a fir called package, go into that package and then type "pip3 install tldextract --target ."
However, I get an error message:
distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base
I have searched through this:
Combine --user with --prefix error with setup.py install
But to no avail.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 360, in run
prefix=options.prefix_path,
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/usr/lib/python3/dist-packages/pip/locations.py", line 153, in distutils_scheme
i.finalize_options()
File "/usr/lib/python3.6/distutils/command/install.py", line 274, in finalize_options
raise DistutilsOptionError("can't combine user with prefix, "
distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base```
You may have moved passed this, but just in case it helps (this drove me up a wall for the last half hour):
I'm running Debian and was trying to install pymysql, but try issuing the command with sudo:
sudo pip3 install tldextract --target .
I don't know why this worked yet, but will update with more info if I come across any. Files were installed in my local directory owned by root, which is unfortunate, but chown fixed that.

Permission Error in Installing opencv-contrib-python

I am creating a face recognition system using Python and OpenCV on these versions:
Python 3.6.2 (64-bit)
OpenCV 3.3.0
When I try to train the face recognizer:
face_recognizer = cv2.face.createLBPHFaceRecognizer()
and also I tried
face_recognizer = cv2.createLBPHFaceRecognizer()
It gave me attribute error
AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'
When I tried
pip install opencv-python
I got these errors
Exception:
Traceback (most recent call last):
File "c:\users\anushi maheshwari\appdata\local\programs\python\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\users\anushi maheshwari\appdata\local\programs\python\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\users\anushi maheshwari\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\users\anushi maheshwari\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\users\anushi maheshwari\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\users\anushi maheshwari\appdata\local\programs\python\python36-32\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\users\anushi maheshwari\appdata\local\programs\python\python36-32\lib\site-packages\pip\wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "c:\users\anushi maheshwari\appdata\local\programs\python\python36-32\lib\shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'c:\\users\\anushi maheshwari\\appdata\\local\\programs\\python\\python36-32\\Lib\\site-packages\\cv2\\cv2.cp36-win32.pyd'
I'd been facing the same issue recently. Here's a list of things that went wrong:
You need to uninstall opencv before installing opencv-contrib
Make sure no console is running that has imported cv2 while you execute your installing process
Run the cmd in Administration Mode (Go to the .exe of the cmd program, right click and select 'Run as Administrator')
This should work.
Hope this helps!
In case of windows, in cmd try to run pip install using python executable
python -m pip install opencv-python
if you're using linux, you just have to give it superuser permission:
sudo -s
pip install opencv-python
note: do not use "su" because it does not recognize the "pip" command
You can use the below command i.e add user to the command
pip install --user opencv-contrib-python

Haystack incompatible with Django 1.10?

while installing django-haystack using PIP with django version==1.10`
Collecting django-haystack
Using cached django_haystack-2.5.0-py2-none-any.whl
Collecting Django<1.10 (from django-haystack)
Using cached Django-1.9.9-py2.py3-none-any.whl
Installing collected packages: Django, django-haystack
Found existing installation: Django 1.10
Uninstalling Django-1.10:
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/bin/django-admin'
Why Uninstalling django 1.10 and even why it can't
Using Ubuntu 16.04
Please Notify me if there is a familiar issue like that or even a question here Thanks
Have you tried installing it with sudo ? You usually need to use sudo to install some dependencies

virtualenv install linux error

I receive a funny error when trying to install virtualenv:
$ pip install virtualenv
yields the following error:
Collecting virtualenv
Using cached virtualenv-15.0.2-py2.py3-none-any.whl
Installing collected packages: virtualenv
Exception:
Traceback (most recent call last):
File "/home/matt/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/matt/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/home/matt/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/home/matt/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/matt/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/home/matt/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/matt/.local/lib/python2.7/site-packages/pip/wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/virtualenv.py'
I was wondering if anybody had some insight as to fixing this? I read that there may be reference in usr/bin to older versions of software, this is possible, but this computer is on the newer side. Is the best bet to go in and clear all references to 'virtualenv' (all that I can find that is
)?
Thank you!
The problem is that you're trying to install a package to a location that typically requires root privileges. You can do as #Vince West suggested and run sudo pip install virtualenv, or you can do pip install --user virtualenv, which will install packages to ~/.local/lib/python<version>/site-packages. If you go that route, you'll likely want to make sure $HOME/.local/bin is included in your $PATH.

Resources