I'm new to Pex. I've had success using pex to build my own applications, but I'm running into a roadblock trying to get a more complicated application turned into a functioning pex file. Specifically, I'm trying to turn airflow (from Airbnb) into a pex file.
The pex creation process seems to succeed but when I attempt to launch airflow I receive an error.
Here is my attempt:
root@a27e175e913a:/# pex airflow -c airflow -o airflow4.pex -v
Jinja2 2.8g pex :: Resolving distributions :: Packaging WTForms
Flask 0.10.1
dill 0.2.5
Flask-Login 0.2.11
chartkick 0.4.2
setproctitle 1.1.10
six 1.10.0
itsdangerous 0.24
Flask-Cache 0.13.1
WTForms 2.1
lockfile 0.12.2
SQLAlchemy 1.1.0b2
future 0.15.2
setuptools 24.3.0
thrift 0.9.3
gunicorn 19.3.0
Markdown 2.6.6
funcsigs 0.4
Babel 1.3
MarkupSafe 0.23
pytz 2016.6.1
python-editor 1.0.1
pandas 0.18.1
requests 2.10.0
docutils 0.12
alembic 0.8.6
python-dateutil 2.5.3
croniter 0.3.12
Pygments 2.1.3
numpy 1.11.1
python-daemon 2.1.1
Flask-WTF 0.12
Werkzeug 0.11.10
Mako 1.0.4
airflow 1.7.1.3
Flask-Admin 1.4.0
pex: Building pex: 482359.3ms
pex: Resolving distributions: 479120.6ms
pex: Packaging airflow: 1972.2ms
pex: Packaging dill: 211.9ms
pex: Packaging Markdown: 755.8ms
pex: Packaging setproctitle: 497.9ms
pex: Packaging Flask: 284.3ms
pex: Packaging Babel: 1329.2ms
pex: Packaging croniter: 190.0ms
pex: Packaging pandas: 326731.8ms
pex: Packaging SQLAlchemy: 992.0ms
pex: Packaging thrift: 507.8ms
pex: Packaging future: 459.8ms
pex: Packaging chartkick: 182.9ms
pex: Packaging alembic: 276.1ms
pex: Packaging Mako: 248.7ms
pex: Packaging docutils: 405.1ms
pex: Packaging python-editor: 183.9ms
pex: Packaging itsdangerous: 185.4ms
pex: Packaging numpy: 136437.2ms
pex: Packaging MarkupSafe: 312.7ms
pex: Packaging WTForms: 292.0ms
Saving PEX file to airflow4.pex
root@a27e175e913a:/# ./airflow4.pex -h
Traceback (most recent call last):
File ".bootstrap/_pex/pex.py", line 326, in execute
File ".bootstrap/_pex/pex.py", line 258, in _wrap_coverage
File ".bootstrap/_pex/pex.py", line 290, in _wrap_profiling
File ".bootstrap/_pex/pex.py", line 367, in _execute
File ".bootstrap/_pex/pex.py", line 394, in execute_script
File ".bootstrap/_pex/finders.py", line 284, in get_script_from_distributions
File ".bootstrap/_pex/finders.py", line 268, in get_script_from_distribution
File ".bootstrap/_pex/finders.py", line 241, in get_script_from_egg
File ".bootstrap/pkg_resources/__init__.py", line 1490, in metadata_listdir
File ".bootstrap/pkg_resources/__init__.py", line 1574, in _listdir
OSError: [Errno 2] No such file or directory: '/root/.pex/install/Flask_Login-0.2.11-py2.7.egg.bd7c1959e5c1f6a8c34c070cc93c67b55a45b9b9/Flask_Login-0.2.11-py2.7.egg/EGG-INFO/scripts'
I also tried it with --no-wheel just for fun and got a different error when trying to launch the built .pex.
root@a27e175e913a:/# pex airflow -c airflow -o airflow3.pex -v --no-wheel
Flask-Login 0.2.11 Resolving distributions :: Packaging setuptools
Werkzeug 0.11.10
thrift 0.9.3
funcsigs 0.4
setproctitle 1.1.10
Flask-Cache 0.13.1
python-daemon 2.1.1
gunicorn 19.3.0
MarkupSafe 0.23
airflow 1.7.1.3
Flask-WTF 0.12
chartkick 0.4.2
pytz 2016.6.1
itsdangerous 0.24
python-editor 1.0.1
future 0.15.2
setuptools 24.3.0
requests 2.10.0
Markdown 2.6.6
six 1.10.0
Jinja2 2.8
Mako 1.0.4
SQLAlchemy 1.1.0b2
docutils 0.12
dill 0.2.5
numpy 1.11.1
Flask 0.10.1
alembic 0.8.6
croniter 0.3.12
Babel 1.3
Pygments 2.1.3
pandas 0.18.1
lockfile 0.12.2
WTForms 2.1
Flask-Admin 1.4.0
python-dateutil 2.5.3
pex: Building pex: 515067.0ms
pex: Resolving distributions: 510907.4ms
pex: Packaging airflow: 1362.6ms
pex: Packaging dill: 208.2ms
pex: Packaging Markdown: 235.6ms
pex: Packaging funcsigs: 170.6ms
pex: Packaging setproctitle: 437.6ms
pex: Packaging Pygments: 1198.4ms
pex: Packaging Flask-Login: 149.9ms
pex: Packaging Flask: 349.3ms
pex: Packaging Babel: 1279.0ms
pex: Packaging croniter: 169.8ms
pex: Packaging pandas: 334469.6ms
pex: Packaging SQLAlchemy: 1508.0ms
pex: Packaging gunicorn: 304.2ms
pex: Packaging Flask-Admin: 698.0ms
pex: Packaging python-dateutil: 204.6ms
pex: Packaging python-daemon: 2238.5ms
pex: Packaging thrift: 587.5ms
pex: Packaging Flask-WTF: 183.5ms
pex: Packaging future: 743.5ms
pex: Packaging Jinja2: 271.9ms
pex: Packaging requests: 499.1ms
pex: Packaging chartkick: 161.6ms
pex: Packaging alembic: 317.7ms
pex: Packaging Werkzeug: 350.5ms
pex: Packaging Mako: 255.6ms
pex: Packaging six: 185.3ms
pex: Packaging docutils: 637.9ms
pex: Packaging python-editor: 151.3ms
pex: Packaging itsdangerous: 148.5ms
pex: Packaging numpy: 139877.5ms
pex: Packaging MarkupSafe: 260.5ms
pex: Packaging lockfile: 1148.6ms
pex: Packaging WTForms: 299.9ms
pex: Packaging setuptools: 422.8ms
Saving PEX file to airflow3.pex
root@a27e175e913a:/# ./airflow3.pex --help
Traceback (most recent call last):
File ".bootstrap/_pex/pex.py", line 326, in execute
File ".bootstrap/_pex/pex.py", line 258, in _wrap_coverage
File ".bootstrap/_pex/pex.py", line 290, in _wrap_profiling
File ".bootstrap/_pex/pex.py", line 367, in _execute
File ".bootstrap/_pex/pex.py", line 394, in execute_script
File ".bootstrap/_pex/finders.py", line 284, in get_script_from_distributions
File ".bootstrap/_pex/finders.py", line 268, in get_script_from_distribution
File ".bootstrap/_pex/finders.py", line 241, in get_script_from_egg
File ".bootstrap/pkg_resources/__init__.py", line 1490, in metadata_listdir
File ".bootstrap/pkg_resources/__init__.py", line 1574, in _listdir
OSError: [Errno 2] No such file or directory: '/root/.pex/install/alembic-0.8.6-py2.7.egg.0e6d2814c6032451e79e81ba52a759d635d5e556/alembic-0.8.6-py2.7.egg/EGG-INFO/scripts'
Can anyone point me in the right direction?
Thanks -- your help is much appreciated!
-M