user14827309
user14827309

Reputation:

how to activate existing virtual enviroment (using pipenv)

I am working with a project in django where i am using virtual enviroment using pipenv shell (which created enviroment name (Django_and_Rest-YRrszWnq)) so in this enviroment I have installed many packages releated to this project

Now I started new project and also i want to used above virtual enviroment How to activate this ((Django_and_Rest-YRrszWnq)) enviroment to new project using pipenv command ?

Upvotes: 1

Views: 14379

Answers (2)

Shaounak Nasikkar
Shaounak Nasikkar

Reputation: 314

Try this -

. ~/.local/share/virtualenvs/Django_and_Rest-YRrszWnq/bin/activate

enter image description here

Upvotes: 1

Kishore Sampath
Kishore Sampath

Reputation: 1001

From the environment (Django_and_Rest-YRrszWnq) run pip freeze > requirements.txt and then copy the requirements.txt file to the new project. Then from inside the new project folder, run pipenv shell this creates a new environment. Then run pip install -r requirements.txt. Now you have a new virtual environment with the exact dependencies as the old environment.

If you find this solution helpful, kindly upvote the solution. Thank you.

Upvotes: 1

Related Questions