Author Topic: Python Live Errors stopped working after conda environment switch  (Read 1257 times)

XrstalLens

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
I had live errors in python working to call pylint on one conda environment - it was great. Then I had to build a new environment and switch to that, so I made all the appropriate changes in all the various dialogs (this is quite a pain, BTW. It would be nice to have python environment support like VS Code does). pylint runs fine from the command line and inside the build window. But I cannot get it to run for the live errors any more. I've tried to change it to run a script instead to see what's going on but it doesn't even seem to be doing that. I even did an upgrade to 26.0.1 (from 26.0.0) but it's still not working. Is there any way I can troubleshoot why it's not working? I've messed with all the settings I can find, creating a new live error profile, etc. Nothing seems to be working.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1682
  • Hero Points: 142
Re: Python Live Errors stopped working after conda environment switch
« Reply #1 on: January 21, 2022, 03:45:20 pm »
What platform?  64 bit windows?

One thing to try is to open up a python file, and then in a file manager or terminal go to the configuration directory (location listed in the Help -> About if you're not sure where it is).  From there, go to rte, and open up the rteout file.  Even if your script isn't being called, there may be some error output in there that can give us an idea of what's happening.

For the Options -> Language Settings -> Scripting Langages -> Python > Live Errors configuration for Python, ensure the default profile selects a profile you want, and it's not set to Auto Detect.

One other thing to check is to see if there are any Live Errors profile overrides in the project you have open.  Open up Project -> Project Properties, and go to the Live Errors tab, and see if there are any overrides for Python, and if so if they are referencing the correct profile.

If that doesn't turn up anything, I may need to send you something to enable some logging.  I do have some code for turning some of the compile time logging for Live Errors into logging that can be enabled with a setting, but it's not in the v26.0.x yet. 

XrstalLens

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: Python Live Errors stopped working after conda environment switch
« Reply #2 on: January 21, 2022, 08:20:36 pm »
Thanks for the feedback. Nothing is showing up in the rte directory which is why I'm having so much trouble. If I delete the rte folder it does seem to get re-created, but it's not copying the source file nor creating an rteout file. I've already looked at all the profile settings and there are no overrides.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1682
  • Hero Points: 142
Re: Python Live Errors stopped working after conda environment switch
« Reply #3 on: January 22, 2022, 03:21:25 pm »
The debugging I'll need to put together will need to be a exe or dll.  What platform are you on?  64 bit windows, linux, etc?

Edit: also, can you post your user.cfg.xml?  That will answer other questions I'll probably have as I get this set up.
« Last Edit: January 22, 2022, 03:23:09 pm by patrick »

XrstalLens

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: Python Live Errors stopped working after conda environment switch
« Reply #4 on: January 24, 2022, 10:02:56 pm »
Thanks for looking into it. I'm on 64-bit Windows 10. Config file attached.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1682
  • Hero Points: 142
Re: Python Live Errors stopped working after conda environment switch
« Reply #5 on: January 25, 2022, 12:33:22 pm »
I took your profile and edited it so the pylint points to the location on my system so I could try out your config.  And for me it wouldn't run pylint until I went into the Live Errors page for Python, and changed the "Default Profile" pulldown from <Auto Detect> to "Pylint".  Does it run for you if you make this change?

There's some special casing for Python live errors so it can be Python version aware, and I suspect there's a bug in that code that's causing it not to even try.  I'm going to apply the debug logging to this system and try to track down what exactly is happening.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1682
  • Hero Points: 142
Re: Python Live Errors stopped working after conda environment switch
« Reply #6 on: January 25, 2022, 04:18:38 pm »
This is definitely a bug.  I'll work on a hotfix for this today.

The code that tries to pick between the shipped Pylint and Pylint3 based on the inferred python version when the Default Profile is set to <Auto Detect> was picking Pylint3, but Pylint3 isn't an active profile, so it just acted like there was no active profile available, rather than falling back on the next best option.

I suspect the reason it stopped working when you changed conda environments is in the previous environment it thought it was Python 2.x, and when you switched environments it changed it's decision to Python3.x.  The other part of the bug is a broken heuristic where it's deciding for Python3 because it sees the ZettA3.8 in the path to the python executable. I think that's an accidental remnant of an early version that I need to take out - once it gets this far, it should just determine the version once for the session by running "python --version".

XrstalLens

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: Python Live Errors stopped working after conda environment switch
« Reply #7 on: January 25, 2022, 07:16:34 pm »
Interesting. I'll try selecting the profile explicitly later today but I don't remember that working either. I'll look forward to your hotfix.

Thanks!
Lyle

XrstalLens

  • Junior Community Member
  • Posts: 9
  • Hero Points: 0
Re: Python Live Errors stopped working after conda environment switch
« Reply #8 on: January 26, 2022, 12:26:06 am »
FYI, setting the profile explicitly does seem to fix it, now that I've fixed the other configuration errors.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1682
  • Hero Points: 142
Re: Python Live Errors stopped working after conda environment switch
« Reply #9 on: January 26, 2022, 02:49:38 pm »
Good.  I've put in a fix that will be in the next hotfix release.