ubuntu 18 .04安装 Anconda3

Anaconda 官网下载(Anaconda3-2020.07-Linux-x86_64.sh):

https://www.anaconda.com/

在Product-> Individual Edition->Your data science tookit(download) 点击下载

或者拉到页面底部(Anaconda Installers->Linux->64-Bit (x86) Installer (550 MB) 下载

 我的下载位置页面为:

Anaconcda目录

1.下载后,在“下载”目录下,打开终端,输入

 sudo sh Anaconda3-2020.07-Linux-x86_64.sh

 2. 进入安装页面,输入回车

 3.进入到注册页面,会看到下面的“更多”

4.一直按住回车,进入到如下页面:

进入到注册页面,点击yes

5.然后进入到安装过程

 6.进入到如下图中表示安装已完成

7.重启终端后,即可使用Anaconda3

8/配置环境

编辑~/.bashrc 文件并编辑,博主使用的vim  ,也可用gedit打开。

sudo gedit ~/.bashrc
export PATH="/home/xupp/anaconda3/bin:$PATH"
source ~/.bashrc

修改终端的默认python为anaconda,自此配置完成。

 

配置过程后 在创建容器时出错:运行以下命令:

l1@l1:~$ conda create -n v1 python==3.6
Solving environment: failed

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/l1/.conda/pkgs/urls.txt
  uid: 1000
  gid: 1000

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1000:1000 /home/l1/.conda/pkgs/urls.txt

In general, it's not advisable to use 'sudo conda'.

我的用户名是l1。

后查询问题 发现是权限问题:

需要依照问题执行:
sudo chown 1000:1000 /home/tina/.conda
sudo chown -R tina /home/tina/anaconda3

报错的这部分:

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/l1/.conda/pkgs/urls.txt

是路径上权限问题。

仍然报错,此时显示为:

l1@l1:~$ sudo chown -R l1 /home/l1/anaconda3
l1@l1:~$ conda create -n v1 python==3.6
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.8.5

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /home/l1/anaconda3/envs/v1

  added / updated specs: 
    - python==3.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    sqlite-3.13.0              |                0         4.0 MB
    xz-5.2.5                   |       h7b6447c_0         438 KB
    wheel-0.35.1               |             py_0          36 KB
    readline-6.2               |                2         606 KB
    certifi-2020.6.20          |           py36_0         160 KB
    _libgcc_mutex-0.1          |             main           3 KB
    python-3.6.0               |                0        16.3 MB
    tk-8.5.18                  |                0         1.9 MB
    openssl-1.0.2u             |       h7b6447c_0         3.1 MB
    zlib-1.2.11                |       h7b6447c_3         120 KB
    ca-certificates-2020.7.22  |                0         132 KB
    pip-20.2.2                 |           py36_0         2.0 MB
    setuptools-49.6.0          |           py36_0         927 KB
    libgcc-ng-9.1.0            |       hdf63c60_0         8.1 MB
    ------------------------------------------------------------
                                           Total:        37.8 MB

The following NEW packages will be INSTALLED:

    _libgcc_mutex:   0.1-main         
    ca-certificates: 2020.7.22-0      
    certifi:         2020.6.20-py36_0 
    libgcc-ng:       9.1.0-hdf63c60_0 
    openssl:         1.0.2u-h7b6447c_0
    pip:             20.2.2-py36_0    
    python:          3.6.0-0          
    readline:        6.2-2            
    setuptools:      49.6.0-py36_0    
    sqlite:          3.13.0-0         
    tk:              8.5.18-0         
    wheel:           0.35.1-py_0      
    xz:              5.2.5-h7b6447c_0 
    zlib:            1.2.11-h7b6447c_3

Proceed ([y]/n)? y


Downloading and Extracting Packages
sqlite-3.13.0        |  4.0 MB | ####################################### | 100% 
xz-5.2.5             |  438 KB | ####################################### | 100% 
wheel-0.35.1         |   36 KB | ####################################### | 100% 
readline-6.2         |  606 KB | ####################################### | 100% 
certifi-2020.6.20    |  160 KB | ####################################### | 100% 
_libgcc_mutex-0.1    |    3 KB | ####################################### | 100% 
python-3.6.0         | 16.3 MB | ####################################### | 100% 
tk-8.5.18            |  1.9 MB | ####################################### | 100% 
openssl-1.0.2u       |  3.1 MB | ####################################### | 100% 
zlib-1.2.11          |  120 KB | ####################################### | 100% 
ca-certificates-2020 |  132 KB | ####################################### | 100% 
pip-20.2.2           |  2.0 MB | ####################################### | 100% 
setuptools-49.6.0    |  927 KB | ####################################### | 100% 
libgcc-ng-9.1.0      |  8.1 MB | ####################################### | 100% 
Preparing transaction: done
Verifying transaction: failed

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/l1/.conda/environments.txt
  uid: 1000
  gid: 1000

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1000:1000 /home/l1/.conda/environments.txt

In general, it's not advisable to use 'sudo conda'.

其中主要问题在:

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/l1/.conda/environments.txt
  uid: 1000
  gid: 1000

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1000:1000 /home/l1/.conda/environments.txt

仍然是权限问题。

索性就在针对这个.txt文件赋权限。

sudo chown 1000:1000 /home/l1/.conda/environments.txt

可以成功执行。

 

l1@l1:~$ conda create -n v1 python==3.6
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.8.5

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /home/l1/anaconda3/envs/v1

  added / updated specs: 
    - python==3.6


The following NEW packages will be INSTALLED:

    _libgcc_mutex:   0.1-main         
    ca-certificates: 2020.7.22-0      
    certifi:         2020.6.20-py36_0 
    libgcc-ng:       9.1.0-hdf63c60_0 
    openssl:         1.0.2u-h7b6447c_0
    pip:             20.2.2-py36_0    
    python:          3.6.0-0          
    readline:        6.2-2            
    setuptools:      49.6.0-py36_0    
    sqlite:          3.13.0-0         
    tk:              8.5.18-0         
    wheel:           0.35.1-py_0      
    xz:              5.2.5-h7b6447c_0 
    zlib:            1.2.11-h7b6447c_3

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate v1
#
# To deactivate an active environment, use:
# > source deactivate
#

l1@l1:~$ 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值