skip to Main Content

I have a python project that I previously ran successfully in docker containers, with all dependencies and package versions fixed using pipenv. However, when I tried to launch the project again in Docker after a one year, I encountered several errors.

I’m trying to understand why it worked before but now fails.

Here are some points to consider:

  • Fixed Dependencies: I ensured that all dependencies were pinned in the Pipfile.lock.
  • Docker Setup: My dockerfile and docker-compose.yml have not changed since the last successful run.
  • Error Messages: I am seeing various errors due to packages incompatibility.

I thought about updating the versions of all my packages and libraries, but it’s a bad idea, because after that the project code may partially or completely stop working.

Please don’t judge the question harshly, because I really don’t know what to do with all this.

2

Answers


  1. Chosen as BEST ANSWER

    So I come up with this: I couldn't update dependencies due to that newer versions of pipenv don`t support python 3.7, so I installed older version of pipenv, succefully updated some packages and launched the project.


  2. You can approach this issue from four directions:

    1. Check the Docker base image: Try to retrieve the hash of the base image from when it last worked a year ago, and use that version.
    2. Unpin all versions: Start by unpinning all your dependencies’ versions to see if that resolves the issue. If it doesn’t work, you can gradually reintroduce pins for specific packages as needed.
    3. Selective unpinning: Unpin only the dependencies directly related to the error, and progressively unpin more dependencies until you no longer encounter any issues.
    4. Rebuild dependencies: Remove all your dependencies and add them back one by one, resolving the errors as you go.

    That being said, this process can still be complex and time-consuming, as identifying and solving the root cause may not always be straightforward.

    If you would like and can share you docker file and your dependencies list without exposing anything private (or hide them). It can give someone a chance to help you and try to reproduce the issue, or get an idea what the issue can be

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search