0

I am using virtualenv and virtualenvwrapper. To make an environment, I need to enter sudo -s which leads to Command not installed... (as seen below) although the sudo privileges are provided.

The entire process can be seen as

ordeal

How to get the terminal colors back ?

3
  • also, why do you need to run sudo -s while you already have a shell as root user
    – Kasonnara
    Sep 15, 2020 at 22:20
  • What does your workon wrkscript do exactly?
    – Kasonnara
    Sep 15, 2020 at 22:26
  • I probably got something wrong while setting up virtualenvwrapper and could no longer make virtualenvs without entering the sudo -s. And workon is a tool of virtualenvwrapper that helps me activate the virtualenv.
    – Pe Dro
    Sep 16, 2020 at 7:51

1 Answer 1

0

The color of your terminal is defined by some environment variables like PS1, but each time you start a new bash shell (like when your run sudo -s), the new shell enviroment is initialized by running the .bashrc of the current user (here the user is root whose .bashrc is at /root/.bashrc, and by default root's .bashrc doesn't define colors).

In the same idea virtualenv activation script replace the PS1 enviroment variables in order to add the enviroment name in the prompt and thus may remove the colors at the same time.

Here you seem to restore colors by running your own user .bashrc manually, but if you want a more permanent solution, you need to edit root .bashrc as well as your virtual env activation script to set the PS1 value you want.

This is for the color problem. As for your other errors, the virtualenv binary doesn't seam to be installed correctly, so maybe try reinstalling it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.