'SciPy problem: "No module named 'scipy.sparse._coo'"

I've run a python script that generates sparse coo matrices and saves them into a pickle object. The python version that I used for this script was 3.8 with SciPy 1.8.0. In another environment, I'm trying to open (and read) this pickle file using python v3.6 and SciPy 1.5.4. But, the loading function gives the following error:

No module named 'scipy.sparse._coo'

I'm wondering what is the best way to work around this error? I searched over the Internet and saw some said that the best way is to downgrade SciPy and work with versions below 1.8.0 but as I have two sets of pickle files (one written with Python 3.6 and SciPy 1.5.6 and the other written with 3.8 and SciPy 1.8.0), and generating these matrices is time-consuming, I want to see if there is a way that I can directly convert 1.8.0 pickles to 1.5.4 without having to processing the python script.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source