problems with PYTHONSTARTUP

672 views
Skip to first unread message

matthias

unread,
May 31, 2011, 3:42:27 AM5/31/11
to spyder
Hello,

I just started with spyder/python and have some problems with the
PYTHONSTARTUP environment variable.
As far as I understood the file under PYTHONSTARTUP should be
exectuted when starting the interactive python console. That should be
the case when starting spyder.

But my startup script is not executed no matter what I try.

Any ideas what am I doing wrong?

Thanks for all help
Matthias

David Verelst

unread,
May 31, 2011, 8:43:03 AM5/31/11
to spyd...@googlegroups.com
Hi,

Maybe others now what you mean exactly, but for me it is a bit unclear. Are you working on Linux or Windows? How exactly did you executed the file under PYTHONSTARTUP? Have you tried starting spyder by using the installed short-cut?

From the command line, you could start spyder as follows (on Linux):
python /spyder/install/dir/spyder

Regards,
David


--
You received this message because you are subscribed to the Google Groups "spyder" group.
To post to this group, send email to spyd...@googlegroups.com.
To unsubscribe from this group, send email to spyderlib+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spyderlib?hl=en.


matthias

unread,
Jun 1, 2011, 1:29:49 AM6/1/11
to spyder
Hi,

thanks for the answer and sorry for my unclarity.
Ok, I am trying to be more accurate:
I installed Spyder for WINDOWs (Version 2.0.10) including IPython,
NumPy, SciPY, ...
I start Spyder with a mouse click on the Spyder shortcut.
I have a valid PYTHONSTARTUP environment variable wich (resp. the file
the variable is pointing to) should be executed when starting IPython.
Hence I am expecting that PYTHONSTARTUP is exectued when starting
Spyder but thats not the case and I have no clue what could be wrong.

Hope you understand me better,

kind regards
Matthias

On 31 Mai, 14:43, David Verelst <david.vere...@gmail.com> wrote:
> Hi,
>
> Maybe others now what you mean exactly, but for me it is a bit unclear. Are
> you working on Linux or Windows? How exactly did you executed the file under
> PYTHONSTARTUP? Have you tried starting spyder by using the installed
> short-cut?
>
> From the command line, you could start spyder as follows (on Linux):
> python /spyder/install/dir/spyder
>
> Regards,
> David
>

David Verelst

unread,
Jun 1, 2011, 3:54:34 AM6/1/11
to spyd...@googlegroups.com
Hi,

So do I understand it correctly that spyder starts without problems using the spyder shortcut?

Your question relates to what the PYTHONSTARTUP environment variable and corresponding target are used for since executing that file doesn't seem to start anything? I am not familiar with the PYTHONSTARTUP env variable and corresponding python script. So I am afraid I can't elaborate on that. Maybe Google can help?

As far as I remember from my Windows days, PythonXY provides a shortcut to an interactive IPython console. Is that correct? Otherwise I assume you can start a python or IPython from the windows prompt by either typing python or ipython.

Regards,

David

matthias

unread,
Jun 1, 2011, 6:18:27 PM6/1/11
to spyder
Hi,

I see the problem. In the startup.py script (which is executed when
starting spyder) is a check for the os.environ variable
PYTHONINITCOMMANDS. If not empty the PYTHONSTARTUP is not executed.
In my environment the PYTHONINITCOMMANDS is set when starting spyder :-
(
So I think at this point the best workaround will be to modify the
Spyder startup.py script.

Regards
Matthias

On 1 Jun., 09:54, David Verelst <david.vere...@gmail.com> wrote:
> Hi,
>
> So do I understand it correctly that spyder starts without problems using
> the spyder shortcut?
>
> Your question relates to what the PYTHONSTARTUP environment variable and
> corresponding target are used for since executing that file doesn't seem to
> start anything? I am not familiar with the PYTHONSTARTUP env variable and
> corresponding python script. So I am afraid I can't elaborate on that. Maybe
> Google can help?
>
> As far as I remember from my Windows days, PythonXY provides a shortcut to
> an interactive IPython console. Is that correct? Otherwise I assume you can
> start a python or IPython from the windows prompt by either typing python or
> ipython.
>
> Regards,
>
> David
>
Reply all
Reply to author
Forward
0 new messages