当前位置:   article > 正文

anaconda3轻松解决python环境问题_*** error in `/root/anaconda3/envs/doccano/bin/pyt

*** error in `/root/anaconda3/envs/doccano/bin/python': double free or corru

1 anaconda3简介

Anaconda3是一个用于数据科学和机器学习的Python发行版本,包含了大量的科学包和工具。

Anaconda3还提供了环境管理功能,允许用户在同一台机器上安装和使用多个版本的Python,并且可以轻松切换。

特别是在linux环境,由于python官方只提供了源码安装包,通过源码编译安装可能会出现各种依赖的缺失,安装变得异常麻烦,使用anaconda3能够非常轻松地解决python环境问题。

2 安装anaconda3

本文系统:Ubuntu 20.04.6 LTS

下载安装包:

https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
  • 1

安装:

./Anaconda3-2023.09-0-Linux-x86_64.sh  
  • 1

安装过程:

Welcome to Anaconda3 2023.09-0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 
==================================================
End User License Agreement - Anaconda Distribution
==================================================

Copyright 2015-2023, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:
。。。省略。。。
。。。省略。。。
。。。省略。。。
Do you accept the license terms? [yes|no]
[no] >>> yes
Anaconda3 will now be installed into this location:
/root/anaconda3

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

[/root/anaconda3] >>>    #直接回车,将安装在/root/anconda3目录下
PREFIX=/root/anaconda3
Unpacking payload ...
                                                                                                                     
Installing base environment...


Downloading and Extracting Packages


Downloading and Extracting Packages

Preparing transaction: done
Executing transaction: \ 

    Installed package of scikit-learn can be accelerated using scikit-learn-intelex.
    More details are available here: https://intel.github.io/scikit-learn-intelex

    For example:

        $ conda install scikit-learn-intelex
        $ python -m sklearnex my_application.py

    
                                                                                                                   done
installation finished.
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
   run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>>yes
no change     /root/anaconda3/condabin/conda
no change     /root/anaconda3/bin/conda
no change     /root/anaconda3/bin/conda-env
no change     /root/anaconda3/bin/activate
no change     /root/anaconda3/bin/deactivate
no change     /root/anaconda3/etc/profile.d/conda.sh
no change     /root/anaconda3/etc/fish/conf.d/conda.fish
no change     /root/anaconda3/shell/condabin/Conda.psm1
no change     /root/anaconda3/shell/condabin/conda-hook.ps1
no change     /root/anaconda3/lib/python3.11/site-packages/xontrib/conda.xsh
no change     /root/anaconda3/etc/profile.d/conda.csh
modified      /root/.bashrc

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

Thank you for installing Anaconda3!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76

重新开一个窗口登录生效。

(base) root@db01:~# 
  • 1

安装过程中修改了.bashrc,在文件末尾添加了如下内容:

在这里插入图片描述

2 anaconda3相关操作

2.1 查看环境

conda info –envs
conda info
conda env list
  • 1
  • 2
  • 3

在这里插入图片描述

在这里插入图片描述

2.2 创建环境:

conda create -n milvus python=3.11.7
  • 1

输出:

## Package Plan ##

  environment location: /root/anaconda3/envs/milvus

  added / updated specs:
    - python=3.11.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2023.12.12 |       h06a4308_0         126 KB
    openssl-3.0.12             |       h7f8727e_0         5.2 MB
    pip-23.3.1                 |  py311h06a4308_0         3.3 MB
    python-3.11.7              |       h955ad1f_0        32.8 MB
    setuptools-68.2.2          |  py311h06a4308_0         1.2 MB
    tzdata-2023d               |       h04d1e81_0         117 KB
    wheel-0.41.2               |  py311h06a4308_0         145 KB
    xz-5.4.5                   |       h5eee18b_0         646 KB
    ------------------------------------------------------------
                                           Total:        43.6 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main 
  _openmp_mutex      pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu 
  bzip2              pkgs/main/linux-64::bzip2-1.0.8-h7b6447c_0 
  ca-certificates    pkgs/main/linux-64::ca-certificates-2023.12.12-h06a4308_0 
  ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.38-h1181459_1 
  libffi             pkgs/main/linux-64::libffi-3.4.4-h6a678d5_0 
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1 
  libgomp            pkgs/main/linux-64::libgomp-11.2.0-h1234567_1 
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1 
  libuuid            pkgs/main/linux-64::libuuid-1.41.5-h5eee18b_0 
  ncurses            pkgs/main/linux-64::ncurses-6.4-h6a678d5_0 
  openssl            pkgs/main/linux-64::openssl-3.0.12-h7f8727e_0 
  pip                pkgs/main/linux-64::pip-23.3.1-py311h06a4308_0 
  python             pkgs/main/linux-64::python-3.11.7-h955ad1f_0 
  readline           pkgs/main/linux-64::readline-8.2-h5eee18b_0 
  setuptools         pkgs/main/linux-64::setuptools-68.2.2-py311h06a4308_0 
  sqlite             pkgs/main/linux-64::sqlite-3.41.2-h5eee18b_0 
  tk                 pkgs/main/linux-64::tk-8.6.12-h1ccaba5_0 
  tzdata             pkgs/main/noarch::tzdata-2023d-h04d1e81_0 
  wheel              pkgs/main/linux-64::wheel-0.41.2-py311h06a4308_0 
  xz                 pkgs/main/linux-64::xz-5.4.5-h5eee18b_0 
  zlib               pkgs/main/linux-64::zlib-1.2.13-h5eee18b_0 


Proceed ([y]/n)?y
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50

2.3 删除环境:

conda env list
  • 1

在这里插入图片描述

conda remove -n milvus --all
  • 1

2.4 激活环境:

conda create -n milvus python=3.11.7
conda activate milvus
python --version
  • 1
  • 2
  • 3

在这里插入图片描述

2.5 退出环境:

conda deactivate
  • 1

3 卸载anaconda3

参考:

https://docs.anaconda.com/free/anaconda/install/uninstall/

conda init --reverse --all
  • 1

新开一个窗口:

删除安装目录,例如: rm -rf /root/ anaconda3

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/312995
推荐阅读
相关标签
  

闽ICP备14008679号