https://pantsbuild.org/ logo
#pex
Title
r

rough-minister-58256

01/18/2018, 11:23 PM
Copy code
[omerta show3]$ pex requests -o requests.pex
[omerta show3]$ python2.7 -c "import requests"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named requests
[omerta show3]$ python2.7
Python 2.7.13 (default, Mar  2 2017, 16:22:01) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> UWSGI_PEX = './requests.pex'
>>> sys.path.insert(0, UWSGI_PEX)
>>> sys.path.insert(0, os.path.join(UWSGI_PEX, '.bootstrap'))
>>> from _pex import pex_bootstrapper
>>> import requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named requests
>>> pex_bootstrapper.bootstrap_pex_env(UWSGI_PEX)
>>> import requests
>>> requests.__file__
'/Users/kwilson/.pex/install/requests-2.18.4-py2.py3-none-any.whl.8cc7b78f7356654aee86dfc3d77c12f71ef0bb58/requests-2.18.4-py2.py3-none-any.whl/requests/__init__.pyc'
>>>