现在python3.5越来越流行,这是需要安装anaconda,有时我们仅仅需要安装简化版miniconda,但是安装后往往出现问题,如运行sudo conda *******,提示sudo:conda: command not found,这时需要去掉sudo,运行conda *******,这时出现了问题,提示PermissionError: [Errno 13] Permission denied: '/home/marley/miniconda3/pkgs/cache/db552c1e.json'

这是一个很棘手的问题,需要一定的经验解决,我尝试了很多方法,并查阅了资料,最终通过请教大神成功解决了,在这里分享一下经验:

1.首先检查一下conda安装

please run "cd ~"
then run"ls"

output:

anaconda2                        Hubstaff                           模板
anaconda3                        miniconda3                         视频
Anaconda3-4.3.1-Linux-x86_64.sh  Miniconda3-latest-Linux-x86_64.sh  图片
CarND-LaneLines-P1               pycharm-community-2017.1.1         文档
CarND-Term1-Starter-Kit          Python-3.5.0                       下载
Downloads                        Python-3.5.0.tgz                   音乐
examples.desktop                 公共的                             桌面

没问题,按下面步骤执行

2.检查miniconda

please "cd ~/miniconda3"
then 'ls'

output:bin  conda-meta  envs  etc  include  lib  LICENSE.txt  pkgs  share  ssl

没问题,往下执行

3.检查路径缺失

when you run "vi ~/.bashrc" :
it shows that your path for anaconda is missing
so you have to add it back
now please run 'nano ~/.bashrc

the bottom line "export PATH="/home/marley/miniconda3/bin:$PATH"

没问题,exit nano

4.检查conda

run 'source ~/.bashrc'

run 'conda list' to see any output

output:

# packages in environment at /home/marley/miniconda3:
#
cffi                      1.9.1                    py36_0  
conda                     4.3.11                   py36_0  
conda-env                 2.6.0                         0  
cryptography              1.7.1                    py36_0  
idna                      2.2                      py36_0  
libffi                    3.2.1                         1  
openssl                   1.0.2k                        0  
pip                       9.0.1                    py36_1  
pyasn1                    0.1.9                    py36_0  
pycosat                   0.6.1                    py36_1  
pycparser                 2.17                     py36_0  
pyopenssl                 16.2.0                   py36_0  
python                    3.6.0                         0  
readline                  6.2                           2  
requests                  2.12.4                   py36_0  
ruamel_yaml               0.11.14                  py36_1  
setuptools                27.2.0                   py36_0  
six                       1.10.0                   py36_0  
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
wheel                     0.29.0                   py36_0  
xz                        5.2.2                         1  
yaml                      0.1.6                         0  
zlib                      1.2.8                         3

没问题,但是依然不能运行sudo conda ******

5.检查conda版本

Please run 'conda --version'

output:conda 4.3.11

6.更新conda

please run 'conda update conda'

提示:PermissionError: [Errno 13] Permission denied: '/home/marley/miniconda3/pkgs/cache/db552c1e.json'

7.解决conda权限问题

try this:
sudo chown -R marley:marley /home/marley/miniconda3

then run " conda update conda"

最后提示:conda-4.3.16-p 100% |################################| Time: 0:00:00   1.78 MB/s

表示conda更新好了

8.可以使用conda

conda******


welcome

next time try to google or stackoverflow first


my process was not only based on the experience in bashrc file. But also google 'miniconda3/pkgs/cache/db552c1e.json

you can figure out which is common and which is not common in your error

Logo

学大模型,用大模型上飞桨星河社区!每天8点V100G算力免费领!免费领取ERNIE 4.0 100w Token >>>

更多推荐