No pip or conda command found in my virtual env

Viewed 20

I was working on project and had setup a virtualenv. Everything was working fine until severe got crashed. When the server rebooted, I see all my installed packages in virtualenv is lost. When I try to install packages using "pip" I see "pip : command not found" error. Later, I found that I have pip command is working outside of virtual env but not inside the virtual env. I am not sure how to solve the pip issue. I have few questions which are as follows:

  1. Do I need to set the path of pip inside virtual env to make it work? if yes, how to set it up?
  2. When I check my virtual env folder inside my repository I see the pip, pip3.... that means the virtual env has pip command but show how it is not able to call it.
  3. Should I delete my virtualenv and create new virtualenv? If yes, how I may affect my existing code.

Or is there any other way. Any help would be appreciated. Thanks

1 Answers
# put conda on PATH like
. '/SOMEWHERE/conda/etc/profile.d/conda.sh'
# then
conda activate
# or look under conda\envs
conda env list
# if you were just using base I'd recommend a create
conda create -n environment_name
# yes then reinstall everything
conda activate environment_name

I like putting conda activate environment_name in an rc/profile depending on your terminal type as to where

Related