zoukankan      html  css  js  c++  java
  • Anaconda/Conda创建环境时报错的解决方案

    按照Conda网站上的提示安装完Conda之后,想要用conda create创建环境,一直报错:

    ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'defaults::dbus-1.10.10-0'.
    PermissionError(13, 'Permission denied')
    Attempting to roll back.
    
    
    PermissionError(13, 'Permission denied')
    

    看样子是安装软件包的权限问题。但问题是安装Conda的时候,并没有使用sudo或切换到root下安装,而是直接使用当前用户安装,最后Conda也是被安装在当前用户的目录下。所以感觉不应该是权限的问题。

    但事实就是权限的问题

    我们用ls -l ~/会发现:

    .
    .
    drwxr-xr-x 20 root root 4096 Jun  6 10:22 anaconda3
    .
    .
    

    用户目录下_anaconda3_文件夹的owner是root,而不是当前用户!实在是非常奇怪。目前我还不知道为什么会这样,但是解决方法就很容易了:

    sudo chown -R <USER> anaconda3
    

    这时候再用conda create,就不会报错了,可以顺利创建环境。

    When I use Conda to create new environment, it displayed:

    ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'defaults::dbus-1.10.10-0'.
    PermissionError(13, 'Permission denied')
    Attempting to roll back.
    
    
    PermissionError(13, 'Permission denied')
    

    I finally found that this was because the USER did not have the permission to access the installed Anaconda directory. When I typed ls -l ~/, I found:

    drwxr-xr-x 20 root root 4096 Jun  6 10:22 anaconda3
    

    which was very strange. The owner of anaconda3 is root instead of USER, though I did not use root to install Anaconda. So I sudo chown -R <USER> anaconda3. Solved. Now I can use conda create to create new environment.

  • 相关阅读:
    java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener问题解决
    开发人员系统功能设计常用办公软件分享
    微信自定义菜单url默认80端口问题解决
    Servlet再度学习
    JSP九大内置对象
    linux下安装apache(httpd-2.4.3版本)各种坑
    Ajax原理学习
    Shell脚本了解
    生成Webservice的两种方式(Axis2,CXf2.x)
    Webservice发布
  • 原文地址:https://www.cnblogs.com/yaos/p/6950590.html
Copyright © 2011-2022 走看看