0

I have a packages file (dependencies.conf) for pip including a bunch of packages that my app needs:

argparse==1.2.1 Cython==0.20.2 ... 

In my build process, I download all packages using:

pip install --download=build/modules -r conf/dependencies.conf 

Then in the deployment process, I want to install these files only if the installed version is different than what I need and in the correct order (dependencies)

I'm currently using the following:

for f in modules/*; do pip install -I $f; done 

But this is wrong since it doesn't validate the version (-I is there in order to downgrade packages if needed) and it doesn't handle the right order of dependencies.

Is there a simple method to do that? (I'm basically trying to update the packages in machines that don't have internet connection)

1 Answer 1

0

Get the version using PIP, using the following command

eg. pip freeze | grep Jinja2 Jinja2==2.6

as explained in the following link Find which version of package is installed with pip

then compare this with the version, and run pip install with the appropriate version if necessary

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, but the question was a bit more complicated than that. First, I download all packages (including dependencies), then I need to install the downloaded packages but I don't know the correct order (according to dependencies)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.