Reputation: 177
I'm a beginner to Django and Python, and I've never used virtualenv before. However, I do know the exact commands to activate and deactivate virtual environments (online search). However, this learning course takes time and sometimes I need to split the work over 2 days.
When I create a virtualenv today and do some work, I'm unable to access the same virtualenv tomorrow. Even when I navigate to that folder and type in .\venv\Scripts\activate
, it says "system cannot find specific path".
How can I open already existing virtual environments and the projects within them? Could it be that I need to end my previous session in a certain way for me to access it the next time?
Upvotes: 0
Views: 17141
Reputation: 1
you can use this command it worked for me for reusing your existing venv
$ workon then the name of your existing venv
Upvotes: 0
Reputation: 11
Use this and it will work:
cd $working directory u have virtual env on
pipenv shell
Upvotes: 0
Reputation: 1
File D:\Coding files\Python*recommendation-system\venv\Scripts\activate.ps1* cannot be loaded because running scripts is disabled on this system.
And it resolved my problem.
Upvotes: 0
Reputation: 1161
Even though pipenv had so many problems. I suggest you use it when you are new to virtual env.
Just
pip install pipenv
cd $your-work-directory
pipenv shell
Then you created your project env. You can active it by:
cd $your-work-directory
pipenv shell
You can install packages by:
cd $your-work-directory
pipenv install $yourpackage --skip-lock
Upvotes: 2