Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Pipfile & Pipfile.lock

Why are we ignoring the pipfile?

In the video he uses pipenv install --ignore-pipfile but doesn't explain why he includes that option.

I'm guessing it's because it includes the dev options but it's unclear.

2 Answers

Dave,

Just running pipenv install will retrieve the most up-to-date dependency versions that the pipfile specifications allow. But if the project was originally created a year ago, for instance, pipenv install may install different versions of the dependencies than were used a year ago. Sometimes this is fine, but other times you want the EXACT packages that were originally used, in order to reproduce exactly what was seen a year ago during development. That's when you'd want to ignore the Pipfile and just use the Pipfile.lock with pipenv install --ignore-pipfile. This will ignore the Pipfile and use the Pipfile.lock instead, which is an automatically generated Pipfile that has the exact versions of all the dependencies the project originally used.

He said the production environment is the same as the development environment. I watched the video from 2:50 to the end on the piping install --ignore-pipfile.