Breakthrough-Energy/PowerSimData

Mismatch between python versions in PowerSimData client machine vs. server machine can cause unpickling error

Closed this issue · 2 comments

We saw this when trying to read output data using PowerSimData in Python 3.7, where the server is running is running Python 3.8. During the extraction of output data on the server, pickle files were created using pickle protocol 5. Trying to read these files using Python 3.7 produces the following traceback:

c:\python37\lib\site-packages\powersimdata\scenario\analyze.py in get_pg(self)
    134         """
    135         output_data = OutputData(data_loc=self.data_loc)
--> 136         pg = output_data.get_data(self._scenario_info["id"], "PG")
    137 
    138         return pg
c:\python37\lib\site-packages\powersimdata\output\output_data.py in get_data(self, scenario_id, field_name)
     48 
     49         self._data_access.copy_from(file_name, from_dir)
---> 50         return pd.read_pickle(filepath)
     51 
     52 
c:\python37\lib\site-packages\pandas\io\pickle.py in read_pickle(filepath_or_buffer, compression)
    180                 # We want to silence any warnings about, e.g. moved modules.
    181                 warnings.simplefilter("ignore", Warning)
--> 182                 return pickle.load(f)
    183         except excs_to_catch:
    184             # e.g.
ValueError: unsupported pickle protocol: 5

This may not be something that we want to solve in PowerSimData, but maybe we want to have some details in the docs on installation instructions and debugging issues.

This concerns the client-server installation.

Right now in the installation guide, the On Laptop/Desktop and On Server subsections have each a bullet point related to python installation. Perhaps, in the On server subsection instead of:

  • Install Julia, Python and Gurobi

we could have:

  • Install Python, preferably the same version that you installed locally to avoid potential data serialization issue
  • Install Julia and Gurobi

we've frozen the versions so this shouldn't be an issue anymore