Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'automate': 0.07; 'installed.': 0.07; 'skip:` 10': 0.07; 'tool,': 0.07; 'guys.': 0.09; 'ping': 0.09; 'provisioning': 0.09; 'project,': 0.12; 'be:': 0.16; 'command-line': 0.16; 'machine?': 0.16; 'missing?': 0.16; 'subject:import': 0.16; 'subject:problems': 0.16; 'url:html)': 0.16; 'do,': 0.16; 'all,': 0.19; 'module': 0.19; 'trying': 0.19; 'file,': 0.19; 'options.': 0.19; 'seems': 0.21; 'machine': 0.22; 'install': 0.23; 'error': 0.23; 'script.': 0.24; 'together.': 0.24; '(or': 0.24; 'environment': 0.24; "i've": 0.25; 'source': 0.25; 'script': 0.25; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'requests': 0.31; "skip:' 10": 0.31; 'bunch': 0.31; 'file': 0.32; 'option': 0.32; 'run': 0.32; 'running': 0.33; 'skip:b 30': 0.33; 'there,': 0.34; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'next': 0.36; 'url:org': 0.36; 'effort': 0.37; 'server': 0.38; 'skip:& 10': 0.38; 'problems': 0.38; '(i.e.,': 0.38; 'depends': 0.38; 'to:addr :python-list': 0.38; 'little': 0.38; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'called': 0.40; '8bit%:6': 0.40; 'url:index': 0.63; 'such': 0.63; 'great': 0.65; 'directory:': 0.84; 'url:latest': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=XEvhPMFaRGtmfE1kz5NvJa7MXVGnVkRrwQOt+/Jm5MM=; b=B2Ds1SwnNnmcLHUmYvouWCBIVWdgPr9MFowSDJStkBDJK4lhkSQPhkXXhyuCVb1HU6 Re81rQ0OI6XcnEA03t0dJcHlck8jMO8GYAuXAd8nRD3eI1G7Uu9kHlZY3VpEc3gIwUbj gdR6eJyGqMnPfuI6WndHWq9sahI2RnId+pXcdUxZLu5Rg7YaaZrm8iXQgQklrDuDbiPp OEr0lOUJrdXwsuvPg6dkmSSVAvE/1k4BkGEDGGlsTPtbJcG67ZHLmYOzIZMuqWsiFS3H gF6LkIBKsiF+I2/S/MPqCllLp9gDxdoVclk+T38Zl6LokYVsoSpj2rXhClrg97Kmat+J 8u4A== MIME-Version: 1.0 X-Received: by 10.194.71.6 with SMTP id q6mr15595675wju.98.1413909537294; Tue, 21 Oct 2014 09:38:57 -0700 (PDT) Date: Tue, 21 Oct 2014 12:38:57 -0400 Subject: Pex import problems From: Sam Raker To: python-list@python.org Content-Type: multipart/alternative; boundary=047d7bfd01c8b711240505f17716 X-Mailman-Approved-At: Tue, 21 Oct 2014 19:35:11 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 88 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413912912 news.xs4all.nl 2839 [2001:888:2000:d::a6]:33710 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79392 --047d7bfd01c8b711240505f17716 Content-Type: text/plain; charset=UTF-8 Hi all, I'm trying to use Pex (http://pex.readthedocs.org/en/latest/index.html) to include requests in a little script to ping a server from a machine that doesn't come with pip (or much of anything, really) installed. I'm running into problems outputting a pex file that depends on a local script. I've got a command-line file, `client.py`, that can be called with a few command-line options. I can run `pex -r requests -o client.pex -- client.py`, but when I try `./client.pex -h` I get an error about "no such file or directory: '-h'". Ok, next attempt: `pex -r requests -o client.pex -e client` --> "ImportError: No module named client". I dug around in the code a bit, and from what I can tell, `-e FOO` boils down to `__import__(FOO)`, which I can do, both from the interpreter and from a test script. So what am I missing? The only other option I can think of would be: `pex -r requests -o client.pex` & then write a script that calls `client.py` from the pex environment (i.e., `./client.pex client.py -h` or whatever), and bundle the pex file, `client.py`, and the script together. But that seems like a misuse of the tool, at best. Alternatively/additionally: is there any mailing list/help source for pex? It seems like a great project, but I've not been able to find many resources out there, which is why I'm turning to you guys. (Why not just install pip/requests on the target machine? Because this is part of an effort to automate provisioning of a bunch of machines.) (Why not use pants? Because literally all we need is requests, and that seems like overkill.) --047d7bfd01c8b711240505f17716 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,=C2=A0
I'm trying to use Pex (http://pex.readthedocs.o= rg/en/latest/index.html) to include requests in a little script to ping a se= rver from a machine that doesn't come with pip (or much of anything, re= ally) installed. I'm running into problems outputting a pex file that d= epends on a local script.=C2=A0

I've got a command-line file, `client.py`, that can = be called with a few command-line options. I can run `pex -r requests -o cl= ient.pex -- client.py`, but when I try `./client.pex -h` I get an error abo= ut "no such file or directory: '-h'".=C2=A0

Ok, next attempt: `pex -r = requests -o client.pex -e client` --> "ImportError: No module named= client". I dug around in the code a bit, and from what I can tell, `-= e FOO` boils down to `__import__(FOO)`, which I can do, both from the inter= preter and from a test script. So what am I missing?=C2=A0

The only other option I can = think of would be: `pex -r requests -o client.pex` & then write a scrip= t that calls `client.py` from the pex environment (i.e., `./client.pex clie= nt.py -h` or whatever), and bundle the pex file, `client.py`, and the scrip= t together. But that seems like a misuse of the tool, at best.=C2=A0=

Alternatively/addit= ionally: is there any mailing list/help source for pex? It seems like a gre= at project, but I've not been able to find many resources out there, wh= ich is why I'm turning to you guys.=C2=A0


(Why not just install pip/requests on the target = machine? Because this is part of an effort to automate provisioning of a bu= nch of machines.)=C2=A0
(Why not use pants? Because literally all we need is requ= ests, and that seems like overkill.)=C2=A0
--047d7bfd01c8b711240505f17716--