Calvin
Calvin

Reputation: 33

Moving django project to Github removes its dependency packages

So I'm working on a blog right now with Django and Python. I created a virtual environment and created my project there. I activated my virtual environment every time, so that whenever I do pip install Django or whatever it installs those packages to my virtual environment. However, When I uploaded my project with virtual env to GitHub and downloaded it on my laptop, and do "pip list" only 4 Django packages(pip, pytz, setuptools, virtualenv) are there. They are all different versions from the original too. My original virtual env has these packages below:

certifi 2018.11.29 chardet 3.0.4 Django 2.1.5 django-embed-video 1.2.0 idna 2.8 pip 18.1 pytz 2018.7 requests 2.21.0 setuptools 40.6.3 urllib3 1.24.1 wheel 0.32.3

Can anyone explain to me what is going on?

Upvotes: 2

Views: 68

Answers (1)

Shubho Shaha
Shubho Shaha

Reputation: 2139

When you setup your python project with virtualenv, it install your third party packages on your local machine. That means whenever you copy or clone your repo from github to other machine you have to install all the packages again to run.

To know more about virtulenv please refer to this awesome tutorial.

If you want to build your django project machine independent then I guess Docker is your best bet.

Upvotes: 1

Related Questions