Updating Anaconda fails: Environment Not Writable Error

前端 未结 14 2044
萌比男神i
萌比男神i 2020-12-23 19:54

I\'m trying to update Anaconda and its packages using conda update --name root conda, but it fails every time.

Error message : Environme

14条回答
  •  一向
    一向 (楼主)
    2020-12-23 20:26

    As an alternative, I would suggest looking at your conda config file.

    Reason

    Sometimes for creating a virtual env at a specified location other than the pre-defined path at ~/anaconda3/envs we append the conda config file using: conda config --append envs_dirs /path/to/envs where envs_dirs is a specified function in config file for allocating different paths where conda can find your virtual envs. Removing a recently added path in this config file may solve the problem.

    Solution

    $:> conda config --show envs_dirs
    
        envs_dirs:
        - /home/some_recent_path    # remove this
        - /home/.../anaconda3/envs
    

    Note the value specifing a different directory other than the predefined location, and remove it using

    $:> conda config --remove envs_dirs /home/some_recent_path
    

    Now the config file envs_dirs is set to default location of envs. Try creating a new env now.

提交回复
热议问题