0

I don't know if this is because of virtualenv, but I ran the virtualenv command to set up a tensorflow environment. Now no paths get loaded at all. Nothing works. To do even basic commands (such as ls), I have to run the full script (/bin/ls). I cannot do anything at all unless I manually run export all the paths:

$ export PATH=/bin/:$PATH

etc.

Even after logging out and back in (through SSH), nothing loads.

Interestingly enough, .bashrc and .bash_profile both get loaded (but not succesfully, since they cannot run some of the commands like source). Also I should note that I don't have root access on this machine, so I can't change (or break for that matter) anything globally.

I couldn't get out of the virtualenv either, since "deactivate" didn't work.

What did I break?

techraf
  • 5,941
Sefu
  • 103

1 Answers1

1

You have probably overwritten your $PATH variable, instead of extending it.

In one of your shell startup files, you probably have an assignment such as

PATH="/some/path"

instead of

PATH="/some/path:$PATH"

Try to find out where you assign to PATH and make sure they never replace $PATH but extend it:

/usr/bin/grep 'PATH=' ~/.bash*

If you cannnot find what is wrong right away, update your answer with pertinent snippets from those files.

As a workaround until you have fixed the errors in your shell script, you can look at /etc/profile where the system-wide $PATH is defined in most Linux/BSD distros. Running

`export PATH="/usr/bin:/usr/local/bin:$HOME/bin"`

should give you access to all tools installed in standard location.

The point of virtualenv is that you define your environments on a per-project basis so as to not clutter your shell startup files with environment-specific code. Remove (comment out) all the setup scripts related to it and rely on the virtualenv tool to create/update a per-directory environment for you.

kba
  • 823
  • 4
  • 13
  • You were right. It was a stupid mistake in a dotfile where I left out the $ in one of the exports. – Sefu Feb 24 '16 at 14:32