title: How does one fix the issue of not writable paths with conda?
body: <p>Why do I see the following error when using conda (usually when installing packages or making new envs) and how do I fix it:</p>
  <pre><code>Verifying transaction: | WARNING conda.core.path_actions:verify(963): Unable to create environments file. Path not writable.
    environment location: /Users/brandomiranda/.conda/environments.txt
  </code></pre>
  <p>or</p>
  <pre><code>Preparing transaction: done
  Verifying transaction: - WARNING conda.core.path_actions:verify(963): Unable to create environments file. Path not writable.
    environment location: /Users/brandomiranda/.conda/environments.txt
  
  done
  Executing transaction: - WARNING conda.core.envs_manager:register_env(52): Unable to register environment. Path not writable or missing.
    environment location: /Users/brandomiranda/miniconda3/envs/myenv
    registry file: /Users/brandomiranda/.conda/environments.txt
  done
  </code></pre>
  <p>a detailed outline of what I did can be found on the following gitissue:</p>
  <p><a href="https://github.com/conda/conda/issues/7267" rel="noreferrer">https://github.com/conda/conda/issues/7267</a></p>
  <p>which really isn't anything too fancy except re-install conda from scratch and run the following command:</p>
  <pre><code>bash Miniconda3-latest-MacOSX-x86_64.sh
  </code></pre>
  <p>and it installed this version of conda:</p>
  <pre><code>❯ conda -V
  conda 4.7.12
  </code></pre>
  <p>Example of command causing me the warnings:</p>
  <pre><code>conda create -n myenv python=3.6
  </code></pre>
  <hr />
  <p>More errors when I install packages with conda:</p>
  <pre><code>Collecting package metadata (current_repodata.json): done
  Solving environment: done
  
  ## Package Plan ##
  
    environment location: /Users/brandomiranda/miniconda3/envs/automl
  
    added / updated specs:
      - jupyterlab
  
  
  The following packages will be downloaded:
  
      package                    |            build
      ---------------------------|-----------------
      jupyter_client-5.3.4       |           py37_0         131 KB  conda-forge
      ------------------------------------------------------------
                                             Total:         131 KB
  
  The following NEW packages will be INSTALLED:
  
    appnope            conda-forge/osx-64::appnope-0.1.0-py37_1000
    attrs              conda-forge/noarch::attrs-19.3.0-py_0
    backcall           conda-forge/noarch::backcall-0.1.0-py_0
    bleach             conda-forge/noarch::bleach-3.1.0-py_0
    decorator          conda-forge/noarch::decorator-4.4.1-py_0
    defusedxml         conda-forge/noarch::defusedxml-0.6.0-py_0
    entrypoints        conda-forge/osx-64::entrypoints-0.3-py37_1000
    importlib_metadata conda-forge/osx-64::importlib_metadata-1.3.0-py37_0
    ipykernel          conda-forge/osx-64::ipykernel-5.1.3-py37h5ca1d4c_0
    ipython            conda-forge/osx-64::ipython-7.11.1-py37h5ca1d4c_0
    ipython_genutils   conda-forge/noarch::ipython_genutils-0.2.0-py_1
    jedi               conda-forge/osx-64::jedi-0.15.2-py37_0
    jinja2             conda-forge/noarch::jinja2-2.10.3-py_0
    json5              conda-forge/noarch::json5-0.8.5-py_0
    jsonschema         conda-forge/osx-64::jsonschema-3.2.0-py37_0
    jupyter_client     conda-forge/osx-64::jupyter_client-5.3.4-py37_0
    jupyter_core       conda-forge/osx-64::jupyter_core-4.6.1-py37_0
    jupyterlab         conda-forge/noarch::jupyterlab-1.2.4-py_0
    jupyterlab_server  conda-forge/noarch::jupyterlab_server-1.0.6-py_0
    libsodium          conda-forge/osx-64::libsodium-1.0.17-h01d97ff_0
    markupsafe         conda-forge/osx-64::markupsafe-1.1.1-py37h0b31af3_0
    mistune            conda-forge/osx-64::mistune-0.8.4-py37h0b31af3_1000
    more-itertools     conda-forge/noarch::more-itertools-8.0.2-py_0
    nbconvert          conda-forge/osx-64::nbconvert-5.6.1-py37_0
    nbformat           conda-forge/noarch::nbformat-5.0.3-py_0
    notebook           conda-forge/osx-64::notebook-6.0.1-py37_0
    pandoc             conda-forge/osx-64::pandoc-2.9.1.1-0
    pandocfilters      conda-forge/noarch::pandocfilters-1.4.2-py_1
    parso              conda-forge/noarch::parso-0.5.2-py_0
    pexpect            conda-forge/osx-64::pexpect-4.7.0-py37_0
    pickleshare        conda-forge/osx-64::pickleshare-0.7.5-py37_1000
    prometheus_client  conda-forge/noarch::prometheus_client-0.7.1-py_0
    prompt_toolkit     conda-forge/noarch::prompt_toolkit-3.0.2-py_0
    ptyprocess         conda-forge/noarch::ptyprocess-0.6.0-py_1001
    pygments           conda-forge/noarch::pygments-2.5.2-py_0
    pyrsistent         conda-forge/osx-64::pyrsistent-0.15.7-py37h0b31af3_0
    python-dateutil    conda-forge/noarch::python-dateutil-2.8.1-py_0
    pyzmq              pkgs/main/osx-64::pyzmq-18.1.0-py37h0a44026_0
    send2trash         conda-forge/noarch::send2trash-1.5.0-py_0
    terminado          conda-forge/osx-64::terminado-0.8.3-py37_0
    testpath           conda-forge/noarch::testpath-0.4.4-py_0
    tornado            conda-forge/osx-64::tornado-6.0.3-py37h0b31af3_0
    traitlets          conda-forge/osx-64::traitlets-4.3.3-py37_0
    wcwidth            conda-forge/noarch::wcwidth-0.1.8-py_0
    webencodings       conda-forge/noarch::webencodings-0.5.1-py_1
    zeromq             conda-forge/osx-64::zeromq-4.3.2-h6de7cb9_2
    zipp               conda-forge/noarch::zipp-0.6.0-py_0
  
  The following packages will be UPDATED:
  
    ca-certificates    pkgs/main::ca-certificates-2019.11.27~ --&gt; conda-forge::ca-certificates-2019.11.28-hecc5488_0
  
  The following packages will be SUPERSEDED by a higher-priority channel:
  
    certifi                                         pkgs/main --&gt; conda-forge
    openssl              pkgs/main::openssl-1.1.1d-h1de35cc_3 --&gt; conda-forge::openssl-1.1.1d-h0b31af3_0
  
  
  
  Proceed ([y]/n)? y
  
  
  Downloading and Extracting Packages
  jupyter_client-5.3.4 | 131 KB    | ################################################################################################################################################################# | 100%
  Preparing transaction: done
  Verifying transaction: | WARNING conda.core.path_actions:verify(963): Unable to create environments file. Path not writable.
    environment location: /Users/brandomiranda/.conda/environments.txt
  
  done
  Executing transaction: - WARNING conda.core.envs_manager:register_env(52): Unable to register environment. Path not writable or missing.
    environment location: /Users/brandomiranda/miniconda3/envs/automl
    registry file: /Users/brandomiranda/.conda/environments.txt
  done
  </code></pre>
  <p>command that I ran:</p>
  <pre><code>(automl) brandomiranda~/automl-meta-learning ❯ conda install -c conda-forge jupyterlab
  </code></pre>
  <hr />
  <p>I tried changing the permission according to the suggested answers, BUT it seems it won't work without sudo. Is it really safe to do sudo here? why isn't it writable to the correct set of users already?</p>
  <pre><code>(automl) brandomiranda~/.conda ❯ if [ -w &quot;/Users/brandomiranda/.conda&quot; ]; then echo &quot;WRITABLE&quot;; else echo &quot;NOT WRITABLE&quot;; fi
  NOT WRITABLE
  (automl) brandomiranda~/.conda ❯ chmod 775 /Users/brandomiranda/.conda
  chmod: Unable to change file mode on /Users/brandomiranda/.conda: Operation not permitted
  </code></pre>
  <hr />
  <h1>Update after running suggested answers</h1>
  <p>I've ran the chmod command in sudo. I checked the permissions of that file and I got the following:</p>
  <pre><code>(automl-meta-learning) brandomiranda~/automl-meta-learning/automl/automl ❯ ls -lha /Users/brandomiranda/.conda                                                        
  total 8
  drwxrwxr-x    3 root           staff    96B Jan  5 16:57 .
  drwxr-xr-x+ 117 brandomiranda  staff   3.7K Jan 19 17:25 ..
  -rw-r--r--    1 root           staff    32B Jan  5 16:57 environments.txt
  </code></pre>
  <p>I checked this because I tried to install <code>conda-build</code> with <code>conda install conda-build</code> command but got the error towards the end:</p>
  <pre><code>Preparing transaction: done
  Verifying transaction: \ WARNING conda.core.path_actions:verify(963): Unable to create environments file. Path not writable.
    environment location: /Users/brandomiranda/.conda/environments.txt
                                                                                                                                                                                                                                                                         done
  Executing transaction: \ WARNING conda.core.envs_manager:register_env(52): Unable to register environment. Path not writable or missing.
    environment location: /Users/brandomiranda/miniconda3/envs/automl-meta-learning
    registry file: /Users/brandomiranda/.conda/environments.txt                                                                                                                                                                                                          done
  </code></pre>
  <p>which seemed weird and that when I notice the <code>environment.txt</code> didn't have the same permissions as the other file/directories. I am tempted to chmod that file too but all this business seems to be putting a bandage on the problem. I feel this shouldn't have happened in the first place so I will ask:</p>
  <ul>
  <li>How do we fix this properly?</li>
  <li>How is one suppose to install conda (in the new Catalina OS for Mac using zsh)?</li>
  <li>Regardless of anything, what are the permissions of the <code>/Users/brandomiranda/.conda</code> conda folder suppose to be and should all folders/files have the same permissions?</li>
  </ul>
  <p>for now I will run:</p>
  <pre><code>sudo chmod 775 /Users/brandomiranda/.conda/environments.txt
  </code></pre>
  <p>although, it makes me uneasy that I am having to run <code>sudo</code> for conda related stuff. Anyone know how to do this without requiring sudo or is sudo supposed to be required?</p>
  <p>As a side comment, I am glad I never tried installing anything from conda using sudo and only changed the permissions of a few folders/files. That seems much safer than allowing conda to run arbitrary code in sudo (instead here it can run its stuff to a specific location while NOT running in sudo, so I guess changing folder permissions isn't that bad?).</p>