miniconda使用

安装&start up

==============================================
https://conda.io/projects/conda/en/latest/user-guide/install/linux.html


Miniconda3 will now be installed into this location:
/root/miniconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/miniconda3] >>> /data/miniconda3
PREFIX=/data/miniconda3
Unpacking payload ...
                                                                                                                                                                                                            
Installing base environment...


Downloading and Extracting Packages


Downloading and Extracting Packages

Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish the installer to initialize Miniconda3
by running conda init? [yes|no]
[no] >>> yes
no change     /data/miniconda3/condabin/conda
no change     /data/miniconda3/bin/conda
no change     /data/miniconda3/bin/conda-env
no change     /data/miniconda3/bin/activate
no change     /data/miniconda3/bin/deactivate
no change     /data/miniconda3/etc/profile.d/conda.sh
no change     /data/miniconda3/etc/fish/conf.d/conda.fish
no change     /data/miniconda3/shell/condabin/Conda.psm1
no change     /data/miniconda3/shell/condabin/conda-hook.ps1
no change     /data/miniconda3/lib/python3.8/site-packages/xontrib/conda.xsh
no change     /data/miniconda3/etc/profile.d/conda.csh
modified      /root/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

If you'd prefer that conda's base environment not be activated on startup, 
   set the auto_activate_base parameter to false: 

conda config --set auto_activate_base false

Thank you for installing Miniconda3!

  • conda: command not found
  • 去到 /data/miniconda3/bin 执行 source activate
  • ./conda init
  • source ~/.bashrc

conda更改pkg和env缓存路径

  • package cache 和 envs directories
conda info

     active environment : sys_test
    active env location : /home/**username/.conda/envs/sys_test
            shell level : 2
       user config file : /home/**username/.condarc
 populated config files : 
          conda version : 23.3.1
    conda-build version : not installed
         python version : 3.8.16.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=11.6=0
                          __glibc=2.31=0
                          __linux=5.11.0=0
                          __unix=0=0
       base environment : /data/miniconda3  (read only)
      conda av data dir : /data/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /data/miniconda3/pkgs
                          /home/**username/.conda/pkgs
       envs directories : /home/**username/.conda/envs
                          /data/miniconda3/envs
               platform : linux-64
             user-agent : conda/23.3.1 requests/2.28.1 CPython/3.8.16 Linux/5.11.0-46-lowlatency ubuntu/20.04.1 glibc/2.31
                UID:GID : 63194:63194
             netrc file : None
           offline mode : False
  • cd ~
    vim .condarc
envs_dirs:
  - /data/miniconda3/envs

pkgs_dirs:
  - /data/miniconda3/pkgs
  • 如果报错NoWritablePkgsDirError: No writeable pkgs directories configured.需要对文件夹进行权限的分配

pip install遇到"No space left on device"

  • 原因:linux出现tmp空间满的情况解决

  • 可用pip config set global.cache-dir ./tmpbak/ 或 pip install … --no-cache-dir

你可能感兴趣的:(其他,python,开发语言)