rez-bind Python2 and Python3

478 views
Skip to first unread message

Marcelo Sercheli

unread,
May 6, 2021, 3:27:59 PM5/6/21
to rez-config
What is the correct way to bind both, Python 2 and Python 3?

I am running Linux CentOS 7.
I have both, Python 2.7.5 and Python 3.6.8 installed in my Linux system.

After running REZ install, I can see under the install directory /lib/python2.7
This is expected I guess.

Running rez-bind python produces the expected result.
A python-2.7.5 package is rez-installed locally.
The executable is pointing to the right system Python 2: /bin/python -> /bin/python

Running rez-bind python --exe /bin/python3 produces a unexpected result.
A python-3.6.8 package is rez-installed locally.
The executable is pointing to the right system Python 3" /bin/python -> /bin/python3
But, when running rez-env python-3 -- python, I get an error related to encodings/__init.py.
Seams like rez-bind used the rez-installed Python2.7 to provide modules for the python3 variant during rez-bind.

So, how can I have both variants of Python available and using the proper modules and libraries?

Thanks for the help.
Marcelo

Python 2 is used during REZ installation.
Running "rez-bind python", REZ install python-2.7.5, as expected.
Running "rez-bind python --exe /bin/python3", REZ install python-3.6.8, but using files from Python2. The executable is pointing to the right place, as specified in the "--exe" parameter, but it fails when calling "python" (which points to /bin/python3) from within the environment created by rez-env python-3
Reply all
Reply to author
Forward
0 new messages