You are not logged in.

#1 2019-08-24 00:04:50

capmcrackawaka
Member
Registered: 2019-08-23
Posts: 3

Terminal automatically activates python environment (base)

Hi,

I have a truly bizarre problem which started occurring after my PC shutdown unexpectedly. Whenever I start my PC and open a new terminal, I appear to be running in an activated python virtual environment (base).

Evidence:
When I start a terminal, the displayed executor is

(base) [sam@ka0dl0 ~]

instead of

[sam@ka0dl0 ~]

When I run

conda deactivate

it deactivates the VE normally.

About the shutdown:
1) I was downloading the libreOffice tar.gz at the time, I don't know if this may have caused it.
2) I have 32GB of RAM and wasn't doing anything memory intensive, so I don't believe it was an out of memory exception.
3) When I rebooted, I did notice several MCE errors in journalctl -b:

Aug 23 19:15:00 kaOdlO kernel: mce: [Hardware Error]: CPU 3: Machine Check: 0 Bank 5: bea0000000000108
Aug 23 19:15:00 kaOdlO kernel: mce: [Hardware Error]: TSC 0 ADDR 1ffffab718854 MISC d012000101000000 SYND 4d000000 IPID 500b000000000 
Aug 23 19:15:00 kaOdlO kernel: mce: [Hardware Error]: PROCESSOR 2:800f11 TIME 1566587696 SOCKET 0 APIC 3 microcode 8001126

This tells me that there was a CPU error, but I don't know how to go about diagnosing the problem further. I would prefer not to have to run conda deactivate on every boot... And also keep unintended shutdowns from happening. Any help is appreciated.

Offline

#2 2019-08-24 00:18:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: Terminal automatically activates python environment (base)

Does this happen in a tty, or just a virtual terminal?  What shell are you using?  What's in your shell configs?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2019-08-24 00:23:19

loqs
Member
Registered: 2014-03-06
Posts: 19,062

Re: Terminal automatically activates python environment (base)

How is conda installed?

Offline

#4 2019-08-24 00:47:15

capmcrackawaka
Member
Registered: 2019-08-23
Posts: 3

Re: Terminal automatically activates python environment (base)

Trilby wrote:

Does this happen in a tty, or just a virtual terminal?  What shell are you using?  What's in your shell configs?.

This does happen in tty before I start my x server. Originally, my ~/.bash_profile contained:

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
  exec startx
fi

I commented out the exex startx to see if the problem occurred in tty, and it does. However, this led me to look at my ~/.bashrc file, which includes the lines:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/sam/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/sam/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/sam/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/sam/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

I am not fluent enough in bash to immediately tell if this is causing the problem, but it gives me a good place to start. Thanks!

loqs wrote:

How is conda installed?

conda is located in ~/anaconda3/condabin/conda, it was installed by running the .sh from the anaconda website.

Offline

#5 2019-08-24 00:49:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: Terminal automatically activates python environment (base)

Why is there a bunch of garbage in your bashrc that you didn't put there?  That almost certainly is the cause of the problem.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2019-08-24 01:50:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Terminal automatically activates python environment (base)

loqs wrote:

How is conda installed?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2020-05-27 20:46:27

TimelyPeach
Member
Registered: 2020-05-09
Posts: 13

Re: Terminal automatically activates python environment (base)

You probably installed Anaconda. If so, the solution that they provide on the website should work:

conda config --set auto_activate_base False

Offline

Board footer

Powered by FluxBB