Bug 458164 - Notebook with Python not working
Summary: Notebook with Python not working
Status: RESOLVED WORKSFORME
Alias: None
Product: LabPlot2
Classification: Applications
Component: backend (other bugs)
Version First Reported In: 2.9.0
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: Stefan Gerlach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-22 10:34 UTC by michael.guyonnet
Modified: 2024-08-06 11:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
attachment-2354888-0.html (1.80 KB, text/html)
2024-08-05 20:51 UTC, michael.guyonnet
Details
attachment-2490696-0.html (2.31 KB, text/html)
2024-08-06 10:43 UTC, michael.guyonnet
Details
attachment-2497156-0.html (2.49 KB, text/html)
2024-08-06 11:23 UTC, michael.guyonnet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description michael.guyonnet 2022-08-22 10:34:29 UTC
Notebook with Python 3.10.6 not working
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Labplot2 see i have Python isnatlled and i can create a notebook with Python.

I type some basic codes x= 1 y=2 z= x+y....Execute line by line...nothing happens, i can only click on Interrupt and it interrupts.


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Alexander Semke 2022-09-04 17:32:02 UTC
(In reply to michael.guyonnet from comment #0)
> Notebook with Python 3.10.6 not working
>[...]
Unfortunately, LabPlot works only with the version of Python that was used during the compilation of the application. For the windows version it is Python 3.8, all other versions won't work. We're thinking already about how to make LabPlot more flexible here. Please use Python 3.8 if possible for you until then.
Comment 2 Bartimaeus 2022-10-04 17:26:58 UTC
I have Python 3.8.10 installed and have the same issue (with LabPlot v 2.9.0 on Windows). What *exact* version of Python is needed for this version of LabPlot? There isn't any indication in the program itself that I can find that says this (seems like having this specified in the components tab of the "About LabPlot" dialog would be a good idea). LabPlot also doesn't seem to be able to detect that it's the wrong version of Python (or isn't providing any sort of warning to the user). It would be nice if LabPlot could give a warning to tell the user what they need to do to get the feature working until a more flexible solution can be found.
Comment 3 Alexander Semke 2022-10-06 20:00:35 UTC
(In reply to Bartimaeus from comment #2)
> I have Python 3.8.10 installed and have the same issue (with LabPlot v 2.9.0
> on Windows). What *exact* version of Python is needed for this version of
> LabPlot? There isn't any indication in the program itself that I can find
> that says this (seems like having this specified in the components tab of
> the "About LabPlot" dialog would be a good idea). LabPlot also doesn't seem
> to be able to detect that it's the wrong version of Python (or isn't
> providing any sort of warning to the user). It would be nice if LabPlot
> could give a warning to tell the user what they need to do to get the
> feature working until a more flexible solution can be found.
Yes, this area needs definitely more attention from us and we're looking already into into how to enable different versions and to improve the error handling.

As to your first question, it should work with 3.8.10. Did you add python executable to PATH on your computer. If yes, does you get the same result as described in this ticket - you're able to create a python notebook, type in an expression and don't get it evaluated - or is LabPlot immediately crashing for you once you try to add a new python notebook?
Comment 4 Bartimaeus 2022-10-11 18:23:32 UTC
(In reply to Alexander Semke from comment #3)
> (In reply to Bartimaeus from comment #2)
> > I have Python 3.8.10 installed and have the same issue (with LabPlot v 2.9.0
> > on Windows). What *exact* version of Python is needed for this version of
> > LabPlot? There isn't any indication in the program itself that I can find
> > that says this (seems like having this specified in the components tab of
> > the "About LabPlot" dialog would be a good idea). LabPlot also doesn't seem
> > to be able to detect that it's the wrong version of Python (or isn't
> > providing any sort of warning to the user). It would be nice if LabPlot
> > could give a warning to tell the user what they need to do to get the
> > feature working until a more flexible solution can be found.
> Yes, this area needs definitely more attention from us and we're looking
> already into into how to enable different versions and to improve the error
> handling.
> 
> As to your first question, it should work with 3.8.10. Did you add python
> executable to PATH on your computer. If yes, does you get the same result as
> described in this ticket - you're able to create a python notebook, type in
> an expression and don't get it evaluated - or is LabPlot immediately
> crashing for you once you try to add a new python notebook?

Checking Python install location in cmd:
C:\Users\[username]>where python
C:\Users\[username]\AppData\Local\Microsoft\WindowsApps\python.exe

My user Path variable has: %USERPROFILE%\AppData\Local\Microsoft\WindowsApps

I get the same behavior as described in the ticket-- able to create a python notebook, type in an expression and don't get it evaluated

I've uploaded an image with two screenshots and some annotations to show the behavior: https://imgur.com/a/oPdZgQF


I also tried adding to the System environment Path variable with no change in behavior
Comment 5 Stefan Gerlach 2022-10-13 09:43:10 UTC
The Python backend currently only works with Python 3.8 which can be installed from the official Python website (version 3.8.10). A minimal installation is sufficient (without Python launcher and without setting the path).
The Python at C:\Users\[username]\AppData\Local\Microsoft\WindowsApps\python.exe is version 3.10 from the Microsoft Store and does not work.
Comment 6 Stefan Gerlach 2022-10-13 09:52:28 UTC
Both, an installation as administrator (in C:\Program Files\Python38) or as user (C:\Users\[Username]\AppData\Local\Programs\Python\Python38) works (tested on Windows 10).
Did you uninstall 3.10.X before installing 3.8.10? Do you use Windows 10?
Comment 7 Bartimaeus 2022-10-24 17:45:52 UTC
(In reply to Stefan Gerlach from comment #6)
> Both, an installation as administrator (in C:\Program Files\Python38) or as
> user (C:\Users\[Username]\AppData\Local\Programs\Python\Python38) works
> (tested on Windows 10).
> Did you uninstall 3.10.X before installing 3.8.10? Do you use Windows 10?

I am using Windows 10. I do not have 3.10.X installed (3.8 was the version available on the Microsoft store when I installed Python)

checking with command line:
python
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Comment 8 Stefan Gerlach 2022-11-10 22:46:32 UTC
Can you try installing Python 3.8 from the official Python page instead of the Microsoft store? I guess the package from MS Store is not complete and thus not working.
Comment 9 Alexander Semke 2023-03-25 14:28:30 UTC
We released recently 2.10 (https://labplot.kde.org/2023/03/21/labplot-2-10/). This release required python 3.10. Please give it a try and reopen this ticket if you still have this problem.
Comment 10 michael.guyonnet 2024-08-05 20:51:58 UTC
Created attachment 172323 [details]
attachment-2354888-0.html

Hi,

I updated to LabPlot 2.11 from 2.9....CAS Python does not work
anymore...which Python version is supported with 2.11 ?

rgds,
Michael

On Sat, Mar 25, 2023 at 3:28 PM Alexander Semke <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=458164
>
> Alexander Semke <alexander.semke@web.de> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>              Status|CONFIRMED                   |RESOLVED
>          Resolution|---                         |WORKSFORME
>                  CC|                            |alexander.semke@web.de
>
> --- Comment #9 from Alexander Semke <alexander.semke@web.de> ---
> We released recently 2.10 (
> https://labplot.kde.org/2023/03/21/labplot-2-10/).
> This release required python 3.10. Please give it a try and reopen this
> ticket
> if you still have this problem.
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 11 Alexander Semke 2024-08-06 06:26:22 UTC
(In reply to michael.guyonnet from comment #10)

> I updated to LabPlot 2.11 from 2.9....CAS Python does not work
> anymore...which Python version is supported with 2.11 ?

For LabPlot 2.11 python 3.11 is required, see also https://userbase.kde.org/LabPlot/FAQ#Which_version_of_Python_do_I_need_to_install_to_work_with_in_in_LabPlot%3F.
Comment 12 michael.guyonnet 2024-08-06 10:43:35 UTC
Created attachment 172337 [details]
attachment-2490696-0.html

thanks !

I installed 3.11.9, Labplot now sees it, it can execute basic Python
commands in Labplot BUT does not recognize any of the packages I installed
( ModuleNotFoundError: No module named 'matplotlib').

I tried w/ 3.11.7 ( after removing 3.11.9), the same issue.

In Python console, these packages are recognized.

Using windows 11 Pro.

thanks,
Michael


On Tue, Aug 6, 2024 at 8:26 AM Alexander Semke <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=458164
>
> --- Comment #11 from Alexander Semke <alexander.semke@web.de> ---
> (In reply to michael.guyonnet from comment #10)
>
> > I updated to LabPlot 2.11 from 2.9....CAS Python does not work
> > anymore...which Python version is supported with 2.11 ?
>
> For LabPlot 2.11 python 3.11 is required, see also
>
> https://userbase.kde.org/LabPlot/FAQ#Which_version_of_Python_do_I_need_to_install_to_work_with_in_in_LabPlot%3F
> .
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 13 michael.guyonnet 2024-08-06 11:23:11 UTC
Created attachment 172338 [details]
attachment-2497156-0.html

looks like Cantor is pointing to the default Python version 3.11.7 it was
compiled with, even if I install 3.11.7 packages are not recognized.

folding back on Labplot 2.9 with Python 3.8...working fne

On Tue, Aug 6, 2024 at 12:43 PM Michael Guyonnet <michael.guyonnet@gmail.com>
wrote:

> thanks !
>
> I installed 3.11.9, Labplot now sees it, it can execute basic Python
> commands in Labplot BUT does not recognize any of the packages I installed
> ( ModuleNotFoundError: No module named 'matplotlib').
>
> I tried w/ 3.11.7 ( after removing 3.11.9), the same issue.
>
> In Python console, these packages are recognized.
>
> Using windows 11 Pro.
>
> thanks,
> Michael
>
>
> On Tue, Aug 6, 2024 at 8:26 AM Alexander Semke <bugzilla_noreply@kde.org>
> wrote:
>
>> https://bugs.kde.org/show_bug.cgi?id=458164
>>
>> --- Comment #11 from Alexander Semke <alexander.semke@web.de> ---
>> (In reply to michael.guyonnet from comment #10)
>>
>> > I updated to LabPlot 2.11 from 2.9....CAS Python does not work
>> > anymore...which Python version is supported with 2.11 ?
>>
>> For LabPlot 2.11 python 3.11 is required, see also
>>
>> https://userbase.kde.org/LabPlot/FAQ#Which_version_of_Python_do_I_need_to_install_to_work_with_in_in_LabPlot%3F
>> .
>>
>> --
>> You are receiving this mail because:
>> You reported the bug.
>
>