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


Groups > comp.lang.python > #91108

Re: PYTHONPATH when calling from ipython

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: PYTHONPATH when calling from ipython
Date 2015-05-23 10:12 +0100
References <874mn5qjc8.fsf@Equus.decebal.nl>
Newsgroups comp.lang.python
Message-ID <mailman.268.1432372378.17265.python-list@python.org> (permalink)

Show all headers | View raw


On 22/05/2015 06:20, Cecil Westerhof wrote:
> I am looking into using ipython instead of bash. But when I call a
> python program from ipython PYTHONPATH is not set. So pythonscripts
> that need a module through PYTHONPATH will not work.
>
> I could do something like:
>      !PYTHONPATH=~/Python/PythonLibrary python2 …
>
> But I find that a little bit cumbersome. Is there a better way to do
> it?
>

What makes you think this?  Have you tried:-

 >>> import os
 >>> os.environ['PYTHONPATH']
'C:\\Users\\Mark\\Documents\\Cash\\Python;C:\\Users\\Mark\\Documents\\MyPython'

That might be from the command line interpreter but it also works the 
same from iPython for me on Windows 8.1.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Thread

PYTHONPATH when calling from ipython Cecil Westerhof <Cecil@decebal.nl> - 2015-05-22 07:20 +0200
  Re: PYTHONPATH when calling from ipython Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-23 10:12 +0100
    Re: PYTHONPATH when calling from ipython Cecil Westerhof <Cecil@decebal.nl> - 2015-05-23 12:53 +0200
      Re: PYTHONPATH when calling from ipython Peter Otten <__peter__@web.de> - 2015-05-23 15:25 +0200
        Re: PYTHONPATH when calling from ipython Cecil Westerhof <Cecil@decebal.nl> - 2015-05-23 16:08 +0200
          Re: PYTHONPATH when calling from ipython Laura Creighton <lac@openend.se> - 2015-05-23 17:00 +0200
            Re: PYTHONPATH when calling from ipython Cecil Westerhof <Cecil@decebal.nl> - 2015-05-23 17:24 +0200
          Re: PYTHONPATH when calling from ipython Peter Otten <__peter__@web.de> - 2015-05-23 18:09 +0200
            Re: PYTHONPATH when calling from ipython Cecil Westerhof <Cecil@decebal.nl> - 2015-05-23 19:30 +0200
              Re: PYTHONPATH when calling from ipython Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-23 19:13 +0100
                Re: PYTHONPATH when calling from ipython Cecil Westerhof <Cecil@decebal.nl> - 2015-05-23 21:47 +0200
              Re: PYTHONPATH when calling from ipython Cecil Westerhof <Cecil@decebal.nl> - 2015-05-23 20:14 +0200

csiph-web