wooden-thailand-8386
10/20/2020, 5:57 PMpex
file and they are pretty much the same.. have the same .deps
the libs are there.. __init__
files where they should be… so I’m very confused.. I’ve been trying to troubleshoot this for a while but now I’m kinda puzzled/stuck.jolly-midnight-72759
10/20/2020, 6:11 PMpants.toml
allow py2 and py3? If so, I have found that I need to explicitly declare my `pex_binary`'s compatibility to get the pex I am looking for.wooden-thailand-8386
10/20/2020, 6:13 PM>=3.7,<3.8
wooden-thailand-8386
10/20/2020, 6:14 PMhundreds-father-404
10/20/2020, 6:16 PMzip_safe=False
in the pex_binary
(formerly python_binary
) target alsowooden-thailand-8386
10/20/2020, 6:20 PMwooden-thailand-8386
10/20/2020, 6:21 PMpex_binary
pex_binary(
name = "rasa_bot_pex",
entry_point = "rasa",
dependencies = [
# We don't have any import statements (nor python files).
# Inference won't work here.
"libs/rasa_services",
"libs/rasa_clue_components",
"libs/rasa_toolbox",
],
output_path="rasa_bot.pex",
compatibility = "CPython>=3.7,<3.8",
zip_safe=False,
)
wooden-thailand-8386
10/20/2020, 6:22 PMwooden-thailand-8386
10/20/2020, 6:23 PM.pex
and open the python interpreter (or ipython) so I can try to manually import and debug things?jolly-midnight-72759
10/20/2020, 6:25 PMrepl
? Isn't that the same thing? pants repl --shell=ipython project/src/python/rasa_bot:rasa_bot_pex
jolly-midnight-72759
10/20/2020, 6:26 PMdiff -r dir1 dir2
to compare the pex's from v1 and v2?hundreds-father-404
10/20/2020, 6:26 PM./pants run path/to:pex
, but it’s slightly different in that the source files won’t go into that pex, only third party deps will go infast-nail-55400
10/20/2020, 6:27 PMPEX_INTERPRETER=1
to get a replwooden-thailand-8386
10/20/2020, 6:28 PMdiff
but I should have used it.wooden-thailand-8386
10/20/2020, 6:29 PMwooden-thailand-8386
10/20/2020, 6:30 PMjolly-midnight-72759
10/20/2020, 6:34 PMhundreds-father-404
10/20/2020, 6:34 PMwooden-thailand-8386
10/20/2020, 6:35 PMfrom my_lib import MyClass
and it found it and imported it.wooden-thailand-8386
10/20/2020, 6:35 PM.pex
directly it gives me a ModuleNotFoundErrorwooden-thailand-8386
10/20/2020, 6:36 PM./rasa_bot.pex
jolly-midnight-72759
10/20/2020, 6:36 PMfrom my_lib import MyClass
work when you use that same py3.7's repl (sans pex)?wooden-thailand-8386
10/20/2020, 6:37 PMwooden-thailand-8386
10/20/2020, 6:38 PMpoetry shell
(or poetry run) first to have that under my venvhundreds-father-404
10/20/2020, 6:39 PMPEX-INFO
file from before and after also. Iirc, it’s at the top level of the unzipped pexwooden-thailand-8386
10/20/2020, 6:39 PMwooden-thailand-8386
10/20/2020, 6:40 PM{
"asctime": "2020-10-20 14:39:54,452",
"module": "run",
"funcName": "serve_application",
"lineno": 193,
"message": "Starting Rasa server on <http://localhost:5005>"
}
wooden-thailand-8386
10/20/2020, 6:40 PMhundreds-father-404
10/20/2020, 6:40 PMwooden-thailand-8386
10/20/2020, 6:41 PMwooden-thailand-8386
10/20/2020, 6:43 PMjolly-midnight-72759
10/20/2020, 6:43 PMpoetry shell
?wooden-thailand-8386
10/20/2020, 6:43 PMwooden-thailand-8386
10/20/2020, 6:43 PMwooden-thailand-8386
10/20/2020, 7:09 PMmodule_mapping
and then everything kinda worked. It wasn’t happening on v1 because I was explicitly adding all my dependencies.hundreds-father-404
10/20/2020, 7:10 PMwooden-thailand-8386
10/20/2020, 7:10 PM"python-json-logger": ["pythonjsonlogger"]