Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31744

Re: Python on Windows

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <mail@timgolden.me.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'subject:Python': 0.05; 'pypi': 0.07; 'setup.py': 0.07; 'subject:Windows': 0.09; 'python': 0.09; 'subdirectory': 0.09; 'cc:addr:python-list': 0.10; 'elsewhere.': 0.16; 'feedparser': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'least,': 0.16; 'message-id:@timgolden.me.uk': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'tjg': 0.16; 'url:pip': 0.16; 'variable.': 0.16; 'wrote:': 0.17; 'mechanism': 0.17; 'previously': 0.18; 'windows': 0.19; 'module': 0.19; 'variable': 0.20; 'import': 0.21; 'cc:2**0': 0.23; 'installed': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; '(which': 0.26; 'setting': 0.26; 'there.': 0.28; 'environment': 0.29; 'argue': 0.29; 'install': 0.29; 'url:python': 0.32; 'file': 0.32; 'received:192.168.100': 0.33; 'that,': 0.34; 'there': 0.35; 'but': 0.36; 'url:org': 0.36; 'subject:: ': 0.38; 'things': 0.38; 'received:192': 0.39; 'little': 0.39; 'received:192.168': 0.40; "you'll": 0.62; 'charset:windows-1252': 0.65; 'from:addr:mail': 0.71; '(ie': 0.84; 'about,': 0.84; 'to:none': 0.93
Date Fri, 19 Oct 2012 15:00:13 +0100
From Tim Golden <mail@timgolden.me.uk>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version 1.0
CC python-list@python.org
Subject Re: Python on Windows
References <1pKdnT9EiNaO2ODNnZ2dnUVZ8rCdnZ2d@bt.com> <JY2dnYfmpcsEyRzNnZ2dnUVZ8vadnZ2d@bt.com>
In-Reply-To <JY2dnYfmpcsEyRzNnZ2dnUVZ8vadnZ2d@bt.com>
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2508.1350655217.27098.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1350655217 news.xs4all.nl 6883 [2001:888:2000:d::a6]:41147
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31744

Show key headers only | View raw


On 19/10/2012 14:24, graham wrote:
> Python was installed in the subdirectory C:\Python27 with the file
> feedparser.py residing in C:\Python27\Lib\email.
> 
> Setting the Windows environment variable (which did not previously
> exist) to C:\Python27\Lib\email allowed me to import feedparser
> successfully.

As an aside, this is not the best use of the PYTHONPATH
variable. (I would argue that, on Windows at least, there's very little
need for the env var).

In general, you'll want to be using a mechanism such as pip:

  http://pypi.python.org/pypi/pip

which will look things up on PyPI so you can just do "pip install
newmodule". This will install into c:\python27\lib\site-packages. The
same for a module you install "manually" (ie python setup.py install) or
via an .exe or an .msi from PyPI or elsewhere.

There are other possibilities: .pth files, the PYTHONPATH env var,
virtualenv, user-install directories which you can read about, but in
general, just let the standard mechanisms install into
c:\python27\lib\site-packages (which is automatically on sys.path) and
go from there.

TJG

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python on Windows graham <grahams@tectime.com> - 2012-10-16 12:29 +0100
  Re: Python on Windows Marco Nawijn <nawijn@gmail.com> - 2012-10-16 04:35 -0700
    Re: Python on Windows Dwight Hutto <dwightdhutto@gmail.com> - 2012-10-16 07:56 -0400
  Re: Python on Windows Joel Goldstick <joel.goldstick@gmail.com> - 2012-10-16 07:44 -0400
  Re: Python on Windows graham <grahams@tectime.com> - 2012-10-19 14:24 +0100
    Re: Python on Windows Tim Golden <mail@timgolden.me.uk> - 2012-10-19 14:44 +0100
    Re: Python on Windows rusi <rustompmody@gmail.com> - 2012-10-19 06:48 -0700
    Re: Python on Windows Tim Golden <mail@timgolden.me.uk> - 2012-10-19 15:00 +0100
    Re: Python on Windows graham <grahams@tectime.com> - 2012-10-19 15:12 +0100
      Re: Python on Windows Tim Golden <mail@timgolden.me.uk> - 2012-10-19 15:24 +0100
    Re: Python on Windows Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-19 15:23 +0100
    Re: Python on Windows Tim Golden <mail@timgolden.me.uk> - 2012-10-19 15:40 +0100
    Re: Python on Windows Gisle Vanem <gvanem@broadpark.no> - 2012-10-20 14:47 +0200

csiph-web