Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating "virtualenv" for an existing project

I have a python on which I've been working on. Now I've realized that I need a virtual environment for it. How can I create it for an existing project? If I do this:

 virtualenv venv

will it work fine? Or do I have to re-create my project, create virtualenv and then copy the existing files to it?

like image 770
Gaji Avatar asked Jan 19 '17 16:01

Gaji


People also ask

Should I create VENV for every project?

You should always create a virtual environment. It's easy to interact with, and it allows you to avoid conflicts between projects. Show activity on this post. Only the python interpreter (executable) and a few things like pip, easy_install are copied to the local directory for your venv project.


1 Answers

You can just create an virtual enviroment with virtualenv venv and start it with venv/bin/activate.
You will need to reinstall all dependencies using pip, but the rest should just work fine.

like image 129
BigZ Avatar answered Oct 24 '22 19:10

BigZ