Statsmodels: Use statsmodels under alternative name - modify .so files

Created on 23 Jul 2020  路  3Comments  路  Source: statsmodels/statsmodels

Hello,

I came across the need to use two statsmodels versions in the same environment (0.8.0 & 0.11.0). That happens because I'm trying to integrate a new product to an older environment that already uses statsmodels 0.8.0. My new product includes holt-winters model, which is not available in version 0.8.0. In order to achieve that, I cloned the repo and modified its name and all the import statements accordingly.

The problem starts because directory statsmodels.tsa.statespace contains 6 encoded .so files that still refer to the old name.

If anybody (owner or anyone else), possesses a working version of the so. files which refer to an alternative package name (e.g. not 'statsmodels'), and can share it with me, it would be great. I can accept any version that has the holt-winters model (0.11.0 is just an example).

I already tried modifying it manually, I managed to access the file contents with the solution mentioned in this link , and figured out that the contents length should remain the same and that the hexadecimal values should be modified (and not the text). Yet, manual modification of each occasion correctly and accurately seems like an undoable work. What makes it so difficult is that the vim file search does not recognize line breaks (Illustration attached), and each occasion of 'statsmodels' can be cut after each character. So, it will require manual check of at least tens of thousands cases in each file.

If you have any other solution for using two versions in the same environment, you may share as well.

Thanks,
Yaniv

Annotation 2020-07-23 170952

All 3 comments

You should do the following.

  1. Clone git
  2. git checkout maintenance/0.8.x
  3. Using something like vscode, replace every occurrence of statsmodels with statsmodels8
  4. From inside the top level of the git repo, mv statsmodels statsmodels8.
  5. python setup.py install

Now you can use import statsmodels8.

In [1]: import statsmodels8

In [2]: statsmodels8.__version__
Out[2]: '0.8.0'
  1. Install and then import old code using statsmodels8 and new code using statsmodels.

Closing since there is nothing for us to do. This is not a supported way to use statsmodels (or any other Python package AFAIK). But feel free to ask follow ups if not clear.

You could so the same thing in reverse to install master or a later version by renames it to statsmodels11

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samosun picture samosun  路  4Comments

josef-pkt picture josef-pkt  路  5Comments

mustafaaydn picture mustafaaydn  路  4Comments

ksomemo picture ksomemo  路  5Comments

AshtonDu picture AshtonDu  路  3Comments