[Eric] Is it a eric5-5.1.3 issue?
Detlev Offenbach
detlev at die-offenbachs.de
Fri Jun 17 17:30:12 BST 2011
Hello Algis,
this is the algorithm used by eric to determine, if the file loaded is a
Python2 or a Python3 file.
1. If the first line is a she-bang line, Python3 scripts are detected by the
presence of the string "python3". Lines containing "python2" or "python" are
considered Python2 sources.
2. If the file does not contain such a line, the type is determined by the
file extension. This can be configured via the config dialog, Python page.
An alternative is to override the algorithm by placing a flag inside the a
comment at the end of the file. For a Python2 file this would be
# eflag: FileType = Python2
or
# eflag: FileType = Python3
The error indication is given because eric tries to check the file loaded for
correct syntax. Because eric5 is a Python3 application it has to start an
external Python2 interpreter. That one should be configured an the page given
below. Maybe eric should try harder to determine it by itself?
Regards,
Detlev
On Donnerstag, 16. Juni 2011, Algis Kabaila wrote:
> On Friday 17 June 2011 02:18:06 Detlev Offenbach wrote:
> > On Donnerstag, 16. Juni 2011, Algis Kabaila wrote:
> > > Hi,
> > >
> > > Downloaded eric5-5.1.3 and installed with python3.2. I want to move my
> > > python scripts to python3 (python3.2 to be precise). Have PyQt4 latest
> > > stable version installed as well as QScintilla-gpl-2.5.1, all with
> > > python3.2.
> > >
> > > I am so glad that I can return to eric with python3.2 - a great IDE for
> > > Python and PyQt!
> > >
> > > I do experience one issue - on occasions eric comes up with an error
> > > message
> > >
> > > "Error python2 interpreter not configured".
> >
> > Can you describe the situation that message shows up?
>
> As soon as a file is opened in the edit window, the debug kicks in. The bug
> symbol and the message appears near the shebang line. The shebang is
>
> #!/usr/bin/env python3.2 or
> #!/usr/bin/env python3
>
> I should also say here that initially the script may be written for python2
> and the shebang may initially be
>
> #!/usr/bin/env python
>
> Initially the file has an "extension" of *.py. I have been changing it to
> *.py3 in an attempt to escape the error message. This seems to sometimes
> work, though not always.
>
> > > I do not understand why it should complain about python2, as I am using
> > > it for python3.2 only. Also, Python 2.7.1+ is installed on the same OS
> > > - kubuntu 11.04 "natty".
> > >
> > > Can I "configure python2" somehow and continue to use eric5 in peace?
> > > Can you help?
> >
> > You may configure this in the Configuration dialog, Debugger->Python
> > page.
>
> Thanks for that - I will attempt to do something on that page.
>
> Thank you for your reply - it is helpful!
>
> OldAl.
--
Detlev Offenbach
detlev at die-offenbachs.de
More information about the Eric
mailing list