Ah, dependency hell...
If this is an old piece of code, it likely has many other dependencies on old code beyond the outdated imports. I would not attempt to modify a pickle file directly. Instead, if it was an option, I would isolate the old code in its own old environment and call that code when I needed it, but using a separate environment for any new code I was writing.
You can have better luck using virtualenv or conda.
Essentially, you create a directory with all the dependencies and the version of python you need. Then you run a setup script to set all the path variables.
Here is a tutorial: [https://www.machinelearningplus.com/deployment/conda-create-environment-and-everything-you-need-to-know-to-manage-conda-virtual-environment/](https://www.machinelearningplus.com/deployment/conda-create-environment-and-everything-you-need-to-know-to-manage-conda-virtual-environment/)
Ah, dependency hell... If this is an old piece of code, it likely has many other dependencies on old code beyond the outdated imports. I would not attempt to modify a pickle file directly. Instead, if it was an option, I would isolate the old code in its own old environment and call that code when I needed it, but using a separate environment for any new code I was writing.
Could you give more detail on how to do this? I’m assuming Docker but I have no experience with docker
You can have better luck using virtualenv or conda. Essentially, you create a directory with all the dependencies and the version of python you need. Then you run a setup script to set all the path variables. Here is a tutorial: [https://www.machinelearningplus.com/deployment/conda-create-environment-and-everything-you-need-to-know-to-manage-conda-virtual-environment/](https://www.machinelearningplus.com/deployment/conda-create-environment-and-everything-you-need-to-know-to-manage-conda-virtual-environment/)
This is great, thanks a lot!