Closed zhanwu closed 5 years ago
It almost feels like something like this happened:
jinja2
and a bunch of 'jinja2.xxx' submodules.pex/install
path and the existing jinja2.xxx
submodules cause issueDidn't figure out where - del sys.modules['jinja2']
happened yet, and maybe jinja2.xxx
also needs to be deleted from sys.modules?
Or why does jinja2 needs to be imported in the first place?
The issue is mostly caused by a pex issue: https://github.com/pantsbuild/pex/issues/785 Closing the current one
pants version
: 1.15.0I have
jinja2 2.8
installed in/usr/local/lib/python2.y/dist-packages
and my application has dependency onjinja2 2.10
.Running the packaged pex file yields the following error:
Cause of the error is Python already have the
jinja2.utils
loaded fromjinja 2.8
but notjinja
, and while it tries to loadjinja2
from.pex/install
folder,jinja2/__init__.py
has:To better illustrate the issue, I run
PEX_VERBOSE=9 ./pants repl zirak/src/python/example:hello2
And in the interactive console:
Ran with PEX_VERBOSE=9 the above command and here is the output: