Re: Python on Windows

Discussion in 'Python' started by Tim Golden, Oct 19, 2012.

  1. Tim Golden

    Tim Golden Guest

    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
     
    Tim Golden, Oct 19, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Achim Domma
    Replies:
    0
    Views:
    444
    Achim Domma
    Jul 19, 2003
  2. Replies:
    1
    Views:
    375
    David Fraser
    Nov 26, 2004
  3. Michael Kearns
    Replies:
    35
    Views:
    1,868
  4. Max M
    Replies:
    1
    Views:
    429
    Brandon K
    Oct 10, 2005
  5. Replies:
    8
    Views:
    666
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 11, 2007
Loading...

Share This Page