apoo
apoo

Reputation: 15

How can I move installed Django src and other djano apps to a new location(pip) in Ubuntu?

I have installed Django and loads of other apps with it. I am using Ubuntu, and I didn't initially use virtualenv so all the Django stuff are in my /user/local/lib/python2.6/dist-packagaes. Whereas my project is in Alex/workplace/projectx/src. I have Alex/workplace/projectx/projectx-env. How can I move all my Django stuff from their installed location to my project virtualenv folder?

I am doing this because I want to install git in the project x so if I change something in one of the Django apps, I can merge them later on.

Upvotes: 0

Views: 398

Answers (1)

Andrew
Andrew

Reputation: 3332

You can use pip freeze > dependencies.txt while not in the virtualenv to get a list of all the installed packages in your system site-packages. Pare the dependencies.txt file down to just what you need, and inside your virtualenv run pip install -r dependencies.txt.

This method lets you take a subset of the installed packages and also install them in the virtualenv. This way is a whole lot safer than copying files from the system packages to your virtualenv's packages.

Upvotes: 1

Related Questions