3

I started virtualenv on my Mac OS, using the commands

python -m virtualenv envsp
source env/bin/activate

Then it was successfully activated.

Then I entered exit, and I got a response which says

logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

And I could not type anymore.

So, I opened another terminal and tried basic commands such ls rm nano, now it keeps saying

-bash: ls: command not found

I am not sure what have I done. And I can't seem to find any solution to this. So if anyone has any clue about this. Please Please Please help!

One more important information cd command works however.

3
  • Can you try logging out and logging back in? Commented Sep 9, 2019 at 17:56
  • how do I logout and log back in?
    – debchakra
    Commented Sep 10, 2019 at 4:51
  • I mean log out and log back in on MacOS, nothing to do with the Terminal. Commented Sep 10, 2019 at 16:01

1 Answer 1

0

You mixup exit of the shell and deactivate of virtualenv. If you activate a python virtualenv and you want to continue using the shell, then enter deactivate. If you are done for the day with your shell, then exit it.

2
  • As of now I added export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin this line on top of my .bash_profile. Things are working again. But what is the better way to resolve this?
    – debchakra
    Commented Sep 10, 2019 at 4:57
  • You seem to have lost bash initialization files like .bash_profile and .bashrc Commented Sep 13, 2019 at 6:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .