polite-vase-75369
04/07/2021, 7:49 PMLawrences-MacBook-Pro-2:aiq lawrencefinn$ python dist/app_admin_tool.pex
Traceback (most recent call last):
File "/Users/lawrencefinn/Documents/aiq/dist/app_admin_tool.pex/.bootstrap/pex/pex.py", line 394, in execute
File "/Users/lawrencefinn/Documents/aiq/dist/app_admin_tool.pex/.bootstrap/pex/pex.py", line 92, in _activate
File "/Users/lawrencefinn/Documents/aiq/dist/app_admin_tool.pex/.bootstrap/pex/environment.py", line 239, in activate
File "/Users/lawrencefinn/Documents/aiq/dist/app_admin_tool.pex/.bootstrap/pex/environment.py", line 399, in _activate
File "/Users/lawrencefinn/Documents/aiq/dist/app_admin_tool.pex/.bootstrap/pex/environment.py", line 143, in _update_module_paths
File "/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/lawrencefinn/.pex/code/7a8afd2b0ab97a76f9819ebfa3858979ce567b61/gen/__init__.py", line 1, in <module>
__import__('pkg_resources').declare_namespace(__name__)
ImportError: No module named pkg_resources
This used to work, and it works fine on non-mac machines (and maybe other laptops). Im on pants 1.27.0polite-vase-75369
04/07/2021, 7:50 PMhundreds-father-404
04/07/2021, 7:53 PMsetuptools==<version>
to requirements.txt, then add 3rdparty/python:setuptools
to your dependencies
for the python_binary
target. If that works, we can figure out the best approach to address thispolite-vase-75369
04/07/2021, 7:57 PMpolite-vase-75369
04/07/2021, 7:57 PMpolite-vase-75369
04/07/2021, 8:05 PMhundreds-father-404
04/07/2021, 8:07 PMsetuptools
with the pip corresponding to /usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7/lib/python2.7
Also, could you try something like python3 dist/app_admin_tool.pex
? given that it fails with python
(python2)polite-vase-75369
04/07/2021, 8:08 PMpython /Users/lawrencefinn/.pex/code/7a8afd2b0ab97a76f9819ebfa3858979ce567b61/gen/__init__.py
that works finepolite-vase-75369
04/07/2021, 8:08 PMpolite-vase-75369
04/07/2021, 8:09 PMpolite-vase-75369
04/07/2021, 8:09 PMhundreds-father-404
04/07/2021, 8:10 PMpython
binary, e.g. if it's missing pkg_resources. That's consistent that things work on Linux but not Mac, as those are using different Python interpreters to run the PEXpolite-vase-75369
04/07/2021, 8:11 PMpolite-vase-75369
04/07/2021, 8:11 PMhundreds-father-404
04/07/2021, 8:12 PMpolite-vase-75369
04/07/2021, 8:15 PMpolite-vase-75369
04/07/2021, 8:15 PMenough-analyst-54434
04/08/2021, 12:07 AMcurl -sSL <https://github.com/pantsbuild/pex/releases/download/v2.1.39/pex> > pex-2.1.39.pex
2. Use pex tools to extract some PEX-INFO metadata: PEX_MODULE=pex.tools python2.7 pex-2.1.39.pex your.pex info | jq '.distributions,.requirements'
3. And compare to PEX_MODULE=pex.tools python2.7 pex-2.1.39.pex your.pex repository info
Here your.pex
is your pex and python2.7
is shorthand for the full path to the python2.7 discussed above.polite-vase-75369
04/08/2021, 2:12 PMpolite-vase-75369
04/08/2021, 2:17 PMpolite-vase-75369
04/08/2021, 2:20 PMenough-analyst-54434
04/08/2021, 3:34 PMpolite-vase-75369
04/08/2021, 3:38 PMenough-analyst-54434
04/08/2021, 3:57 PM