[Conda] Error: EnvironmentNotWritableError — environment not writable or permission denied — How to Fix It

Summary

The Conda error EnvironmentNotWritableError indicates that you’re trying to modify or install packages in an environment you don’t have write permission for. This usually happens in system-wide or shared environments installed under administrator or root ownership. The solution is to work inside a user-owned environment, adjust folder permissions, or use elevated privileges only when necessary.

Context

Conda environments are directories containing isolated Python installations and dependencies. If an environment is installed in a system path — such as /opt/anaconda3/envs/ on macOS/Linux or C:\ProgramData\Anaconda3\envs\ on Windows — normal users may lack permission to modify it. Attempts to install, update, or remove packages will fail with EnvironmentNotWritableError or PermissionError: [Errno 13] Permission denied. This problem is common in shared or corporate setups, or when Conda was installed globally. The cleanest fix is to create a user-owned environment in your home directory.

Probable Cause

  • Modifying a system-wide or administrator-owned environment.
  • Conda environment directory lacks write permissions for your user account.
  • Corporate or shared configuration restricting write access.
  • Conda installed under protected directories (e.g., Program Files on Windows).
  • Using WSL or network drives without proper ownership permissions.

Quick Fix

Follow these methods based on your setup:

  1. Check which environment is active:
conda info --envs
  1. If it’s a system or shared environment, create your own writable one:
conda create -n myenv python=3.10
conda activate myenv
conda install 
  1. If you must modify the existing environment, use elevated privileges:
# macOS/Linux
sudo conda install 

# Windows
Run Anaconda Prompt as Administrator
  1. Alternatively, make the environment writable:
# macOS/Linux
sudo chown -R $(whoami) /path/to/env

# Windows
Right-click the environment folder → Properties → Security → Edit → allow Full Control
  1. As a last resort, install the package just for your user account via pip:
pip install --user 
  1. Verify installation succeeded:
conda list 

Full Example

A user on macOS runs:

conda install requests

and receives:

EnvironmentNotWritableError: The current user does not have write permissions to the target environment.

They check which environment is active:

conda info --envs
# * /opt/anaconda3/envs/base

Since the environment is system-wide, the user creates a new one:

conda create -n myenv python=3.10
conda activate myenv
conda install requests

The installation now works without elevated permissions. Future updates and installs will also succeed because myenv is owned by the user.

Pitfalls & Debug

  • Symptom: Still can’t write after sudoFix: Check if Conda paths mix root and user ownership; avoid hybrid installs.
  • Symptom: Conda works in base but not in custom env → Fix: Verify environment path and user access permissions.
  • Symptom: Admin rights required every time → Fix: Reinstall Conda as a user (not system-wide).
  • Symptom: “Permission denied” in Program FilesFix: Move environment to a user-owned directory.
  • Symptom: Shared lab or server setup → Fix: Use conda create -p ~/envs/myenv for isolated environments.

Validation & Next Steps

Confirm that your Conda environments are user-owned and writable:

conda info --envs
ls -ld $(conda info --base)/envs/*

If you frequently face permission issues, reinstall Anaconda or Miniconda under your user home directory (e.g., ~/anaconda3 or C:\Users\YourName\Anaconda3). Avoid running Conda under administrative paths to maintain safe, independent control.

Sources

Anaconda Documentation — Troubleshooting Conda
Stack Overflow — “EnvironmentNotWritableError” solutions and permission fixes
conda-forge community threads — ownership and multi-user setup best practices
Anaconda Blog — Safe environment management for shared systems

Labels: Tool/Conda, OS/Windows-macOS-Linux, Topic/Permissions-Environment