I'm trying to install miniconda on a RedHat 9.1 system. I want to install locally, but I consistently get this error:
Unpacking payload ...
Traceback (most recent call last):
File "entry_point.py", line 59, in <module>
File "concurrent/futures/process.py", line 642, in __init__
File "concurrent/futures/process.py", line 165, in __init__
File "multiprocessing/queues.py", line 43, in __init__
File "multiprocessing/context.py", line 68, in Lock
File "multiprocessing/synchronize.py", line 162, in __init__
File "multiprocessing/synchronize.py", line 57, in __init__
PermissionError: [Errno 13] Permission denied
I've verified that I've download the latest installer and the SHA256 checksum matches what is published on the download page. Also, there is plenty of disk space - /home show 2.4 TB available.
Another user was able to install it using sudo but we should need that, correct? This should be a fully local install and no system files should be written correct?
Is it potentially related to this post?
EDIT
I checked permissions on /dev/shm and see that it does not have write permissions. Looking at another system with CentOS, I see global rwx permissions. It seems this needs to be changed on the RedHat system, but it opens the questions, is this a security risk? and, if not, why are permissions not globally rwx by default?
EDIT
Changing permissions on /dev/shm fixes the issue. The question of whether this is a security risk remains, however.
Related
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.
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!
Doing a simple shelve.open will give the following error:
>>> shelve.open('foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/shelve.py", line 243, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/usr/lib/python3.6/shelve.py", line 227, in __init__
Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
File "/usr/lib/python3.6/dbm/__init__.py", line 94, in open
return mod.open(file, flag, mode)
_gdbm.error: [Errno 22] Invalid argument
I've only come across one related search result to this issue: https://github.com/pydanny/cookiecutter-django/issues/1793#issuecomment-440406112
I got exactly the same error on a Vagrant dev environment. Celery uses dbm for persistent storage, which is built on top of the gdbm C library. Some testing has revealed that this works when creating or opening files on a native filesystem but not on a mounted filesystem.
I'm running this under a Vagrant Ubuntu box in MacOS so it makes sense. I have also run the same box under Windows 10 and this issue doesn't crop up. Any clues for a fix?
I had the same issue and couldn't find any help online until I came across this post
https://github.com/we45/ThreatPlaybook/issues/11
creating a new virtual environment worked for me
I am trying to build AOSP image on my mac Book using Linux virtual box.
Since I don't have enough space on Mac I am trying to checkoutAOSP on external 2 TB Segate HDD which I planned to use for build.
I have installed repo tool and python 2.7 but when I try to init repo with this command
repo init -u https://android.googlesource.com/platform/manifest
It fail with this error message
hitesh#hitesh-VirtualBox:/media/hitesh/2TB/test$ repo init -u https://android.googlesource.com/platform/manifest
Get https://android.googlesource.com/platform/manifest
Traceback (most recent call last):
File "/media/hitesh/2TB/test/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/media/hitesh/2TB/test/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/media/hitesh/2TB/test/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/media/hitesh/2TB/test/.repo/repo/subcmds/init.py", line 399, in Execute
self._SyncManifest(opt)
File "/media/hitesh/2TB/test/.repo/repo/subcmds/init.py", line 171, in _SyncManifest
m._InitGitDir(mirror_git=mirrored_manifest_git)
File "/media/hitesh/2TB/test/.repo/repo/project.py", line 2292, in _InitGitDir
self._UpdateHooks()
File "/media/hitesh/2TB/test/.repo/repo/project.py", line 2312, in _UpdateHooks
self._InitHooks()
File "/media/hitesh/2TB/test/.repo/repo/project.py", line 2341, in _InitHooks
os.symlink(os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
OSError: [Errno 38] Function not implemented
I dont know how to trouble shoot this, I dont understand which function is not implemented,
The repo needs python2, you can first check your python version of Linux is python2 not python3.
I figured it out repo cant be initialise on an external hdd. I had to create a vdi file on my external hard disk and then use that to download aosp source code.
My goal is to serve a hello world Django app that uses postgres on an EC2 instance running Ubuntu. I logged in via ssh and cloned a git repo containing a Django project with this requirements.txt:
Django==1.8.2
djangorestframework==3.1.2
psycopg2==2.6
I created a virtualenv and then, when I ran (ec2_deploy_test)ubuntu#ip-172-31-22-100:~/ec2-deploy-test$ pip install -r requirements.txt, this exception was thrown:
Collecting psycopg2==2.6 (from -r requirements.txt (line 3))
/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning Downloading psycopg2-2.6.tar.gz (367kB)
100% |████████████████████████████████| 368kB 785kB/s Building wheels for collected packages: psycopg2 Exception: Traceback (most
recent call last): File
"/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/basecommand.py",
line 223, in main
status = self.run(options, args) File "/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/commands/install.py",
line 291, in run
wb.build(autobuilding=True) File "/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/wheel.py",
line 753, in build
ensure_dir(output_dir) File "/home/ubuntu/Envs/ec2_deploy_test/local/lib/python2.7/site-packages/pip/utils/init.py", line 70, in ensure_dir
os.makedirs(path) File "/home/ubuntu/Envs/ec2_deploy_test/lib/python2.7/os.py", line 150, in
makedirs
makedirs(head, mode) File "/home/ubuntu/Envs/ec2_deploy_test/lib/python2.7/os.py", line 150, in
makedirs
makedirs(head, mode) File "/home/ubuntu/Envs/ec2_deploy_test/lib/python2.7/os.py", line 150, in
makedirs
makedirs(head, mode) File "/home/ubuntu/Envs/ec2_deploy_test/lib/python2.7/os.py", line 157, in
makedirs
mkdir(name, mode) OSError: [Errno 13] Permission denied: '/home/ubuntu/.cache/pip/wheels/ab'
Then I ran (ec2_deploy_test)ubuntu#ip-172-31-22-100:~/ec2-deploy-test$ sudo pip install -r requirements.txt and psycopg2 installed successfully.
Why would I need root permissions to install a python package in my virtual environment? I am new to Linux and sysadmin in general so all advice is welcome. Thanks in advance.
For some reason you don't have an access to create a directory inside the /home/ubuntu/.cache/pip/wheels/ab. Normally this problem shouldn't appear; anyway, since it happened, just change the rights of the .cache directory recursively. I guess that the problem is an ownership, so try to launch the command sudo chown -R <USERNAME> ~/.cache/pip, where the <USERNAME> supposed to be the name of your user.
An advice — try to not launch an apps from root without a real need in this. Most probably that the directory to which you have no an access was created by some application being run with root rights — and now an ownership messed.
I assume you used virtualenv -p /usr/bin/python3.4 env,
I had the same problem
Its python 3 and might have nothing to do with permissions or root if you tried Angles recommendation and it does not work. You need to install python3-dev ... Or just stick with python2. hope that helps
heres the link: Trouble with psycopg2 in virtualenv python3 for use with Django