wang larry
wang larry

Reputation: 11

Is it possible to use the Redis_OM library in the python 2 code?

We want to leverage the redis OM feature here https://redis.com/blog/introducing-redis-om-for-python/, however, it is only available for the python 3, histrocially, our code use python 2, and it is hard for us to switch to python 3 shortly, so any idea on how to use those python 3 libs in the python2 code?

I googled and found the solution to invoke the python 2 lib from the python3 code, like in below, but not sure how to use the python 3 lib from the python 2 code

  group = execnet.makegateway("popen//python=python2.7")
            ch = group.remote_exec("""
                from Injection.facades.stress_facade import StressFacade
                facade = StressFacade("{}")
                cmd = facade.query_active_jobs()
                channel.send(cmd)
            """.format(ip))

Upvotes: 0

Views: 77

Answers (1)

Simon Prickett
Simon Prickett

Reputation: 4158

sorry this isn't possible. Redis OM for Python was developed recently, after the 2020 sunset date for Python 2.

Upvotes: 1

Related Questions