0
votes

I had created and activated virtualenv and worked on my Django Project. Now scene is that i've Reinstall my Windows 10. Now when i tried to enter my env e.g. workon DFMS I face following error...

'workon' is not recognized as an internal or external command,operable program or batch file.

Or When i tried to run server using python manage.py runserver i face following issue...

ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

My Question is how to activate that old virtualenv for that project? and how to resolve this problem? Thank You.

1
I'm not a windows user.... do you have bash shell? There are really 3 steps to establishing. 1. install python dev env: pip3 install virtualenv 2. in your project dir establish venv python3 -m venv venv 3. assuming your have a requirements.txt install your project packages source venv\bin\activate; pip3 install -r requirements.txt - Rob Raymond

1 Answers

0
votes

You could create a virtual environment with virtualenv venv and start it with venv/bin/activate.

make sure added the directory of your project into environment variable of your computer

you need to run Command prompt as Administrator.