【Ubuntu 系统使用进入,自动进入base虚拟环境解决最全】
项目场景:
在Ubuntu上安装完anaconda后,发现每次打开终端后都会自动进入到base的虚拟环境中去,虽然在这些环境下使用问题不大,但一些软件的安装在虚拟环境下有影响。每次使用conda deactivate退出也很麻烦。
问题描述
安装玩之后,打开终端,发现前面带有“base”,此时,可以输入如下命令,退出base环境:
conda deactivate

解决方案:
方法一:
打开终端,有base环境的,直接输入下面代码,然后新开终端,新开的便会退出环境
conda config --set auto_activate_base false

方法二:
永久取消base字样办法:
1、在新终端中输入:gedit ~/.bashrc
2、在打开的文件最后加上一句命令:conda deactivate
3、重新打开终端即可消除base字样。
若在终端中输入conda deactivate,也可消除base字样,但是一次性的,再次打开终端依然存在base字样。在.bashrc文件添加命令:conda deactivate可以永久消除base字样。
1,通过将auto_activate_base参数设置为false实现:
conda config --set auto_activate_base false
2,那要进入的话通过conda activate base
3,如果反悔了还是希望base一直留着的话通过
conda config --set auto_activate_base true
恢复
@Overridepublic void run() {bytes = mmInStream.read(buffer);mHandler.obtainMessage(READ_DATA, bytes, -1, buffer).sendToTarget();}
解决:在anaconda安装时选择的初始化,.bashrc中的对应文件如下
#作用应该是一打开终端就初始化conda环境# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/s/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; theneval "$__conda_setup"
elseif [ -f "/home/s/anaconda3/etc/profile.d/conda.sh" ]; then. "/home/s/anaconda3/etc/profile.d/conda.sh"elseexport PATH="/home/s/anaconda3/bin:$PATH"fi
fi
unset __conda_setup
# <<< conda initialize <<<
把这段注释掉,如下
#不让conda自己初始化
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
#__conda_setup="$('/home/s/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
#if [ $? -eq 0 ]; then
# eval "$__conda_setup"
#else
# if [ -f "/home/s/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/home/s/anaconda3/etc/profile.d/conda.sh"
# else
# export PATH="/home/s/anaconda3/bin:$PATH"
# fi
#fi
#unset __conda_setup
# <<< conda initialize <<<
此时没有了(base)标志,但是输入python默认的是python2.7.这就是问题2
问题2:消除base后,在终端输入python时发现,此时python的版本不是对应anaconda版本里的
解决:在.bashrc文件末尾加上anaconda的路径,如下
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples# If not running interactively, don't do anything
case $- in*i*) ;;*) return;;
esac# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth# append to the history file, don't overwrite it
shopt -s histappend# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; thendebian_chroot=$(cat /etc/debian_chroot)
fi# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" inxterm-color|*-256color) color_prompt=yes;;
esac# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yesif [ -n "$force_color_prompt" ]; thenif [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then# We have color support; assume it's compliant with Ecma-48# (ISO/IEC-6429). (Lack of such support is extremely rare, and such# a case would tend to support setf rather than setaf.)color_prompt=yeselsecolor_prompt=fi
fiif [ "$color_prompt" = yes ]; thenPS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
elsePS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1";;
*);;
esac# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; thentest -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"alias ls='ls --color=auto'#alias dir='dir --color=auto'#alias vdir='vdir --color=auto'alias grep='grep --color=auto'alias fgrep='fgrep --color=auto'alias egrep='egrep --color=auto'
fi# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.if [ -f ~/.bash_aliases ]; then. ~/.bash_aliases
fi# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; thenif [ -f /usr/share/bash-completion/bash_completion ]; then. /usr/share/bash-completion/bash_completionelif [ -f /etc/bash_completion ]; then. /etc/bash_completionfi
fi#不让conda自己初始化
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
#__conda_setup="$('/home/s/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
#if [ $? -eq 0 ]; then
# eval "$__conda_setup"
#else
# if [ -f "/home/s/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/home/s/anaconda3/etc/profile.d/conda.sh"
# else
# export PATH="/home/s/anaconda3/bin:$PATH"
# fi
#fi
#unset __conda_setup
# <<< conda initialize <<<#显示conda下的Python
export PATH="/home/s/anaconda3/bin:$PATH"
执行
source .bashrc
输入python默认输出conda中的Python了

参考:
ubuntu18.04安装anaconda后终端出现base字样
相关文章:
【Ubuntu 系统使用进入,自动进入base虚拟环境解决最全】
项目场景: 在Ubuntu上安装完anaconda后,发现每次打开终端后都会自动进入到base的虚拟环境中去,虽然在这些环境下使用问题不大,但一些软件的安装在虚拟环境下有影响。每次使用conda deactivate退出也很麻烦。 问题描述 安装玩之…...
C++项目——云备份-⑨-服务端与客户端功能联调
文章目录 专栏导读1.服务端源代码2.客户端源代码3.浏览器访问测试//listshow 4.上传文件测试5.文件下载测试 专栏导读 🌸作者简介:花想云 ,在读本科生一枚,C/C领域新星创作者,新星计划导师,阿里云专家博主&…...
Linux两条服务器实现相互免密登录
1.准备两台虚拟机,一台充当服务器端(server),一台充当客户端(client) 服务器端(server):192.168.75.139 客户端(client):192.168.75…...
华纳云Ubuntu环境怎么编译安装PHP和Nginx
在Ubuntu环境中编译安装PHP和Nginx需要进行一系列步骤。以下是安装PHP和Nginx的一般过程: 1. 更新系统: 首先,确保您的系统是最新的,运行以下命令更新软件包列表和已安装的软件包: sudo apt update sudo apt upgra…...
Ubuntu 23.10(Mantic Minotaur)正式发布,支持Linux 6.5和GNOME 45
导读Canonical 近日正式发布了 Ubuntu 23.10(Mantic Minotaur)操作系统,其中包含一些最新的 GNU/Linux 技术、改进的硬件支持以及许多其他变化。 Ubuntu 23.10 采用了最新的 Linux 6.5 内核系列,并为 Ubuntu 桌面和服务器增强了 z…...
Linux:KVM虚拟化
本章操作基于centos7系统 简介 KVM是Kernel Virtual Machine的简写,目前Redhat只支持在64位的Rhel5.4以上的系统运行KVM,同时硬件需要支持VT技术。KVM的前身是QEMU,在2008年被redhat公司收购并获得了一项hypervisor技术,不过redh…...
HTML标签,列表,表格相关
HTML标签的分类 HTML标签可以分为以下几类: 标题标签:用于定义网页的标题,分为h1、h2、h3、h4、h5和h6。 段落标签:用于定义文本的段落,常用的有p标签。 链接标签:用于定义链接,常用的有a标签…...
【音视频】Linux | FFmpeg源码搭建
Linux | FFmpeg源码搭建 时间:2023-06-21 文章目录 `Linux` | `FFmpeg`源码搭建@[toc]1.参考2.获取源码2-1.建立工作目录2-2.获取`AAC`2-3.获取`X264`2-4.获取`X265`2-5.获取`FFmpeg`3.编译/安装3-1.编译`AAC`3-1-1.解压源码3-1-2.编译3-1-3.安装3-2.编译`X264`3-2-1.解压源码…...
Ansible中常用模块
1.ansible实现管理的方式 Ad-Hoc //利用ansible命令直接完成管理,主要用于临时命令使用场景 playbook //ansible脚本,主要用于大型项目场景,需要前期的规划 2.Ad-Hoc执行方式中如何获得帮助 ansible-doc …...
2000-2021年上市公司产融结合度量数据
2000-2021年上市公司产融结合度量数据 1、时间:2000-2021年 2、指标:股票代码、年份、是否持有银行股份、持有银行股份比例、是否持有其他金融机构股份、产融结合 3、来源:上市公司年报 4、范围:上市公司 5、样本量ÿ…...
2023最新最全Web自动化测试面试题
1、Selenium 中 hidden 或者是 display none 的元素是否可以定位到? 不可以。可以写 JavaScript 将标签中的 hidden 先改为 0,再进行定位元素。 2、Selenium 中如何保证操作元素的成功率?也就是说如何保证我点击的元素一 定是可以点击的&am…...
List的add(int index,E element)陷阱,不得不防
项目场景: 项目中有两个List列表,一个是List1用来存储一个标识,后续会根据这个标识去重。 一个List2是用来返回对象的,其中对象里也有一个属性List3。现需要将重复的标识数据追加到List3 我想到的两个方案: 尽量不动…...
如何使用drawio画流程图以及导入导出
画一个基本的流程图 你可以在线使用drawio, 或者drawon创建很多不同类型的图表。 如何使用编辑器,让我们以一个最基本的流程图开始。 流程图,就是让你可视化的描述一个过程或者系统。 图形和很少部分的文字表达就可以让读者很快的理解他们需要什么。 创…...
腾讯云轻量服务器“镜像类型”以及“镜像”选择方法
腾讯云轻量应用服务器镜像类型分为应用镜像、系统镜像、Docker基础镜像、自定义镜像和共享镜像,腾讯云百科txybk.com来详细说下不同镜像类型说明和详细介绍: 轻量应用服务器镜像类型说明 腾讯云轻量应用服务器 应用镜像:独有的应用镜像除了包…...
docker-compose 简单部署Flask + Redis + Nginx环境搭建网站
主博客目录:《从零开始学习搭建量化平台笔记》 主项目计划需要搭建一个 Flask Redis Nginx环境 来制作一个可视化的网站,为了避免搭完就忘,因此就有了这个博客。 任务:搭建一个内网通信且只有由Nginx代理发放的网页端显示环境。…...
debian和ubuntu
Debian和Ubuntu是两种流行的Linux发行版,它们之间有密切的关系,但也存在一些重要的区别。 关系: Ubuntu是基于Debian创建的。这意味着Ubuntu使用与Debian相同的APT包管理系统,并共享来自Debian库中的大量包和库。 区别…...
恒驰服务 | 华为云数据使能专家服务offering之数仓建设
恒驰大数据服务主要针对客户在进行智能数据迁移的过程中,存在业务停机、数据丢失、迁移周期紧张、运维成本高等问题,通过为客户提供迁移调研、方案设计、迁移实施、迁移验收等服务内容,支撑客户实现快速稳定上云,有效降低时间成本…...
AI与Prompt:解锁软件开发团队的魔法咒语,在复杂任务上生成正确率更高的代码
AI与Prompt:解锁软件开发团队的魔法咒语 写在最前面论文:基于ChatGPT的自协作代码生成将团队协作理论应用于代码生成的研究自协作框架原理1、DOL任务分配2、共享黑板协作3、Instance实例化 案例说明简单任务:基本操作,生成的结果1…...
深度学习02-数据集格式转换
背景: 通常搜集完数据图片后,我们会用labelimg进行图片标注,比较高版本的labelimg支持的标注格式有三种,PascalVOC、YOLO、CreateML,标注的时候可以根据自己的算法模型数据集需求选择相应的格式,当然&…...
【c++|opencv】一、基础操作---1.图像读取
every blog every motto: You can do more than you think. https://blog.csdn.net/weixin_39190382?typeblog 0. 前言 有关c操作opencv记录 1. 正文 1.1 图像读取、显示、保存 // 读取、显示、保存图像#include <opencv2/opencv.hpp> #include <iostream>us…...
DockerHub与私有镜像仓库在容器化中的应用与管理
哈喽,大家好,我是左手python! Docker Hub的应用与管理 Docker Hub的基本概念与使用方法 Docker Hub是Docker官方提供的一个公共镜像仓库,用户可以在其中找到各种操作系统、软件和应用的镜像。开发者可以通过Docker Hub轻松获取所…...
Cesium1.95中高性能加载1500个点
一、基本方式: 图标使用.png比.svg性能要好 <template><div id"cesiumContainer"></div><div class"toolbar"><button id"resetButton">重新生成点</button><span id"countDisplay&qu…...
JDK 17 新特性
#JDK 17 新特性 /**************** 文本块 *****************/ python/scala中早就支持,不稀奇 String json “”" { “name”: “Java”, “version”: 17 } “”"; /**************** Switch 语句 -> 表达式 *****************/ 挺好的ÿ…...
Unity | AmplifyShaderEditor插件基础(第七集:平面波动shader)
目录 一、👋🏻前言 二、😈sinx波动的基本原理 三、😈波动起来 1.sinx节点介绍 2.vertexPosition 3.集成Vector3 a.节点Append b.连起来 4.波动起来 a.波动的原理 b.时间节点 c.sinx的处理 四、🌊波动优化…...
基于Java Swing的电子通讯录设计与实现:附系统托盘功能代码详解
JAVASQL电子通讯录带系统托盘 一、系统概述 本电子通讯录系统采用Java Swing开发桌面应用,结合SQLite数据库实现联系人管理功能,并集成系统托盘功能提升用户体验。系统支持联系人的增删改查、分组管理、搜索过滤等功能,同时可以最小化到系统…...
return this;返回的是谁
一个审批系统的示例来演示责任链模式的实现。假设公司需要处理不同金额的采购申请,不同级别的经理有不同的审批权限: // 抽象处理者:审批者 abstract class Approver {protected Approver successor; // 下一个处理者// 设置下一个处理者pub…...
算法:模拟
1.替换所有的问号 1576. 替换所有的问号 - 力扣(LeetCode) 遍历字符串:通过外层循环逐一检查每个字符。遇到 ? 时处理: 内层循环遍历小写字母(a 到 z)。对每个字母检查是否满足: 与…...
【分享】推荐一些办公小工具
1、PDF 在线转换 https://smallpdf.com/cn/pdf-tools 推荐理由:大部分的转换软件需要收费,要么功能不齐全,而开会员又用不了几次浪费钱,借用别人的又不安全。 这个网站它不需要登录或下载安装。而且提供的免费功能就能满足日常…...
华为OD机考-机房布局
import java.util.*;public class DemoTest5 {public static void main(String[] args) {Scanner in new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextLine()) { // 注意 while 处理多个 caseSystem.out.println(solve(in.nextLine()));}}priv…...
CSS | transition 和 transform的用处和区别
省流总结: transform用于变换/变形,transition是动画控制器 transform 用来对元素进行变形,常见的操作如下,它是立即生效的样式变形属性。 旋转 rotate(角度deg)、平移 translateX(像素px)、缩放 scale(倍数)、倾斜 skewX(角度…...
