New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NotWritableError: The current user does not have write permissions to a required path. #7267
Comments
TEMPORARY WORKAROUND Add to your
(Note that conda checks only the OK. I narrowed it down. It's caused by
This opens new login shell under the specified user. I've seen many people use this practice. I don't really understand what business does Anaconda have with sudo but I suggest to remove this behavior as it breaks legitimate user setups. Anaconda probably expects that sudo is only used to become root, which is far from truth.
Obviously, the user to which I login via sudo doesn't have permissions to |
I am getting the same errors:
I tried deleting my ~/USER/anaconda folder and reinstalling, to no avail. Can anyone help me fix my conda environment? I am not experienced with this type of thing. |
I am getting the same error message although the target path is different. The conda installation is initiated by bcbio_nextgen (https://github.com/bcbio/bcbio-nextgen) but the error comes from conda itself. My job script is running on a server that only permits writing to a temporary work directory, so writing onto my home folder is not allowed. Changing the environment settings with CONDA_ENVS_PATH and CONDA_PKGS_DIRS to a writable directory does not solve the problem. Is there any workaround to avoid this error?
|
Same problem here when done from within a Dockerfile. For consistency with a similarly built EC2 image, I have conda installed as the "ec2-user". All docker commands are issued as root, so I have to do |
This is also a problem when root runs a script containing "conda install" commands as a regular user via
EDIT: another unpleasant workaround for folks to try... Calling my_script.sh (which contains
The contents of
|
Another use-case that is now broken... I have production and test machines where we are supposed to log in using our user accounts, but then deploy software sudo'ed as a common user (this allows for multiple developers to be able to maintain the server, regardless of who deployed the original code). This is completely broken! I am now trying to figure out when was the last version of conda where this worked so that I can continue doing deployments. It seems like it is 4.3.31 is the latest conda installer on repo.continuum.io that will leave you in a usable state. |
Rather than just I’m on my phone right now and can’t tryout the exact commands. Hopefully I’m giving enough hints for you to figure out what I mean though. There’s a subtle difference between Getting all this sudo usage exactly right with conda internals is still a work in progress. I think we are making progress, but we’re not done yet. There are multiple related open issues. Will try to swing back later and link them in here for reference. |
I don't understand why is this discussion this long. There's a full description of the problem, workaround, and hint for the EASY fix in conda in the second post. Workaround: add Fix: Just completely ignore |
I am not doing "sudo conda ...". I am sudo'ed as USERNAME. I am in that
user's bash environment.
…On Fri, May 25, 2018 at 1:57 PM, Marek Howard ***@***.***> wrote:
I don't understand why is this discussion this long. There's a full
description of the problem, workaround, and hint for the EASY fix in conda
in the second post.
Workaround: add unset SUDO_UID SUDO_GID SUDO_USER to ~/.bashrc
Fix: Just completely ignore sudo in conda. There's no need to get sudo
right. Sudo IS right. You are wrong by thinking you have some business with
sudo and by this you're breaking people's setup. Sudo is end user's tool,
not your API.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7267 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AARy-CkBKWH1HM_2KP7JgXiOaJ2iAtU2ks5t2EX8gaJpZM4T2NO8>
.
|
FWIW I have no problem in redhat/centos if I have a user "miniconda2", intall to /opt/miniconda2/ and give access to another user by making them a member of the miniconda2 group. Trying the same thing on debian fails completely for me. |
I have the exact same setup as @WeatherGod. It used to work, but no longer. Please fix this issue! |
Thanks for your work on Conda - it's made our builds and deployments easier and more pleasant. We have a service user (which we |
Based in part on the feedback in this issue, the sudo checks should have already been removed in master. The master branch is currently tagged as 4.6.0beta0. We’ll be following our canary processs of the next several weeks to graduate this feature release into defaults. Definitely encourage use and feedback on the current beta, as it relates to this issue or any other. (Please file unrelated bugs as new issues; not tacked onto this one.) To opt in to the canary releases, execute
|
The same issue with you, there is my answer with the same issue, maybe work for you Solving environment: failed" after conda update conda #7950 |
@kalefranz just realized a problem with testing the canary. This error happens when installing packages or creating environments for the first time. So, if one has this problem, then I don't think they can properly test the canary channel. And, if they are able to update their install of conda, then they already have the files made. One thing I noticed today is that repeated attempts at installing packages gets me closer. On the fourth attempt, everything worked. Each time, it complained about a different file. So, the file is still getting created, it is the chmod'ing that never happens I guess (but, in my case, the permissions are fine as-is). The files that are complained about are, in this order: |
We too run into this issue. Long story short, we use Singularity throughout our continuous integration system (a bit like Docker). In order to keep the 'containers' small, we clear out the /pkgs/* directory. Once everything is set up, this directory (and the entire container) is read-only / sand-boxed. So with pkgs/* gone, we end up deleting the urls.txt file with it. Conda can not re-create this file in a read-only filesystem, and thus we receive the same error os the original poster. I have found, if you touch this file, you can continue to create new environments without errors. Even if this file is empty and read-only.
I realize my workaround probably does not apply to most folks here. Took a while to nail this down, and thought I would mention what worked for us. |
It worked for me! |
I have a comment that I think is related to what @milljm reported on January 29. We had a read-only conda environment where pkgs/urls and pkgs/urls.txt were somehow group writeable even though the rest of pkgs/ were not - especially not pkgs/cache. Commands like "conda create" and "conda search" failed (NotWriteableError) for people in the group because conda was trying open for write the .json files in pkgs/cache. Simply removing the group write bit on pkgs/urls[.txt] fixed the issue because the same commands now went to pkgs/cache in the user's home .conda directory where they do have write. In other words, it seems that conda was checking permissions for pkgs/urls in our read-only environment to determine if it could open the associated pkgs/cache/blah.json for write. And in this case it could not. I'm not going to call this an actual conda bug since I cannot explain how pkgs/urls[.txt] became writeable except to say that it happened when I installed Miniconda to a specific location. But it does seem like conda might be able to work around it. This is easily reproducible in our environment and I am happy to create a separate bug report with more details if someone wants to tell me where a Miniconda installer bug should go. |
Do not do the above! 👍 🎉 ❤️ 🚀 If you needed to use |
Why hasn't there been a miniconda installer released for the 4.6.x series? This bug makes the 4.4.x and 4.5.x series unusable for me. |
There are test installers going through QA now. You can test them yourself at https://repo.anaconda.com/pkgs/misc/previews/miniconda/4.6.12/ There has been a rebuild of conda 4.6.12 since those were created. If you use windows with git bash or msys2, you will probably want to immediately update to 4.6.12 build 1 using the cmd.exe prompt (not bash), and then use bash once you've updated. |
Thank you. I just gave one of them a try and it seemed to have worked (although it did warn me about an unwritable path:
But it kept going and it seemed to have successfully finish the job. |
Have/had the same problem, it would abort with this permission error although everything is fine. This is because I use
The installer mentioned in #7267 (comment) did not fix it for me! |
I wonder if the difference is that in the case of my installer, I was doing it from a docker container where I was originally "root" and used |
I did what you said but the error still persists: NotWritableError: The current user does not have write permissions to a required path. If you feel that permissions on this path are set incorrectly, you can manually $ sudo chmod 502:20 /Users/user/anaconda3/envs/catalog.json How do I solve it? P.S. Of course, sudo chmod 502:20 /Users/user/anaconda3/envs/catalog.json doesn't work, saying chmod: Invalid file mode: 502:20 |
To elaborate my case from #7267 (comment)
The environment Fun fact, even in some bash scripts I 've in However, at the end of the day, technically there is no real permission error. It seems like some part of conda installer is acting prematurely here. |
Hi - I am facing the same issue. And I am on a supercomputer, which means I don't have sudo access to anything. Would appreciate any help! #8553 (Issue) |
You do not have to reinstall with your own user.. instead, you can just create an environment:
and re-run your conda install... |
also worked for me |
This worked for me. |
Same problem. Same solution. Now, why does this happen? |
Two ways to fix the problem. |
I did |
If you are getting this error "NotWritableError: The current user does not have write permissions to a required path." means the conda directory doesn't have enough permissions to download and save new libraries. Just run these commands in the terminal and you're ready:
Change the user name and path to the conda folder according to your PC. Hope this helps! :) Translated with www.DeepL.com/Translator (free version) |
Add the CI to run on MacOS, including building, testing pysinga and uploading the package to anaconda if the token is available. Fix the permission issue conda/conda#7267 and the sdk issue. The sdk is fixed to the latest version (in conda_build_config.yaml). The python is fixed to 3.6 to be compatible with colab.
If I execute this command I get ' chown: invalid user: ‘+x’ ' However, just running the first command fixed the issue for me. |
I installed the conda package manager through my distribution's package manager. How do I know the path-to-conda folder? |
I have this issue when a I try to make a conda environment (in a CI pipeline, for testing a specific package). The container has been build via the standard anaconda docker
and later
which returns
it feels weird that this does not work when we started from the official conda docker? :) |
@caioltfo Is there another work around when you do not have permission to use sudo? |
Hello All, The problem can be fixed by changing the permissions to 777. |
Please do not do this. It opens you up to anyone on the system being able to make changes to your anaconda install. Chances are, in your case, the problem was that you couldn't list, read, and/or execute the contents of the directory where anaconda was installed. Fixing that does not require enabling write access for everyone. |
The solution is assign permissions to the user.
NOTE: As my APPFOLDER is a system folder and is necessary sudo permissions. |
Nothing above worked for me but, bioconda/bioconda-recipes#7950 (comment) worked for me and doesn't require any sudo |
this worked for me,thx! |
basically |
oh man, you brightened my day. I have been stuck by this issues for days!! |
The summary looks like problem happens when the base conda environment (e.g. source ~/miniconda3/bin/activate ) was setup using someone else's base conda . |
We are suddently having this problem when switching from conda 4.9 to 4.11 (in a docker container) btw, the proper way for multiple users to reuse the same conda installation on linux is detailed in the docs here: https://docs.anaconda.com/anaconda/install/multi-user/?highlight=chgrp#multi-user-anaconda-installation-on-linux |
I'm also getting this error on a new Mac. Can you reopen? The error: NotWritableError: All I did was run:
Could you please reopen this issue? |
This solved my problem! |
start your command prompt with run as administrator Using this method can solve your problem |
It can solve the immediate issue, I agree. But further usage of Conda may permanently require elevated permissions moving forward. Generally speaking it is best to start over, and figure out why elevated permissions were required at all. While the rest of my post probably doesn't apply to you (sounds like you may be working with a Windows install), I write the following in hopes of aiding the non-windows folks: Conda should be installed to/in a users home directory, by the user. Conda only needs write access to where you plan on installing it (and we all have write access to our own home directories). Example: bash Mambaforge-Linux-x86_64.sh -b -p ~/mambaforge3 If you are not installing Conda to your home directory, then it is best to first create the directory where you are wanting to install it (using sudo), sudo mkdir -p /some/path
sudo chown -R me /some/path
bash Mambaforge-Linux-x86_64.sh -b -p /some/path/mambaforge3 |
I had the same error. My problem is due to having 2 version of condas installed on the laptop (when M1 chip just came out, I had to install two versions for tensorflow and pytorch). So the directories in the error message:
and
aren't really the directories where I installed my conda. You can generate a .condarc file:
and edit the paths in this file:
Then it worked for me. |
Conda is seriously confused about permissions. Right after I installed Anaconda from
Anaconda3-5.1.0-Linux-x86_64.sh
into my home (/home/marek/anaconda3
) and addedinto my
~/.zshrc
and started new shell, I tried to create new environment:~/.conda
directory didn't exist before I run the command above~/.conda
directory DID exist after I run the command above, though it was empty% touch ~/.conda/foo
worksThis happens on latest ArchLinux, latest Ubuntu (bionic) and with both bash and zsh as shell...
The text was updated successfully, but these errors were encountered: