is this a familiar error for folks? hoping to mayb...
# general
f
is this a familiar error for folks? hoping to maybe to the stack trace from ‘/usr/local/bin/python’
a
i’m trying to think of how to reproduce this with pex alone, because it seems like that error you’ve mentioned shouldn’t be happening
i might also ask in #pex
e
If you read that very literally, it looks like a configuration issue: while trying to execute
['/usr/local/bin/python']
That says PEX is trying to execute a path that looks like a python singleton array literal. Are there relevant bits of your pants.ini this calls to mind that you could paste?
I may have read that too literally. Can you execute any of those 3 paths on your own without error?
f
Yes they execute fine
e
OK. Can you try applying this diff?
Copy code
diff --git a/pex/interpreter.py b/pex/interpreter.py
index db8760a..130a3ed 100644
--- a/pex/interpreter.py
+++ b/pex/interpreter.py
@@ -320,8 +320,12 @@ class PythonInterpreter(object):
       for fn in cls.expand_path(path):
         basefile = os.path.basename(fn)
         if hashbang == basefile:
+          from pex.executor import Executor
           try:
             return cls.from_binary(fn)
+          except Executor.NonZeroExit as e:
+            TRACER.log('Could not identify %s: %s\nSTDOUT:\n%s\nSTDERR:\n%s'
+                       % (fn, e, e.stdout, e.stderr))
           except Exception as e:
             TRACER.log('Could not identify %s: %s' % (fn, e))
You'll have to patch that to something like:
build-support/pants_dev_deps.py37.venv/lib/python3.7/site-packages/pex/interpreter.py
Your exact path may differ depending on the python interpreter pants picked to run under, but there should be just one .venv dir under build-support. If there are more than one you can `rm -rf build-support/.venv` and re-run ./pants to help make it clear.
f
ok I managed to fix the problem by completely cleaning out my brew pythons (+ packages) and reinstalling. I was getting the following issue when running `pip freeze`:
Copy code
pip freeze
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Could not parse requirement: -sycopg2
Could not parse requirement: -orchfile
Could not parse requirement: -
absl-py==0.7.0
agate==1.6.1
agate-dbf==0.2.0
agate-excel==0.2.2
agate-sql==0.5.3
alembic==0.8.10
ansicolors==1.0.2
So something seemed to have gone wrong with my pythons
👌 1
👏 1
e
OK. I did just file https://github.com/pantsbuild/pex/issues/689 to give better logging for this sort of case going forward.
🔥 2