-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maximum recursion error while calling a python dataframe #30446
Comments
I'm just guessing but you might be hitting your stack limit somehow. Probably since qgis doesn't have pandas built-in and is fetching it from elsewhere. Your best bet would be to check for other plugins that use pandas and see how they use it. Otherwise if you depend on pandas and qgis being able to find it, your plugin wont work for most users. |
An alternative might be to use providers that are in qgis and that support your inputs. This would prevent having to rely on pandas. |
Yeah I was able to solve that issue, it turned out almost exactly as you guessed, @roya0045 , creating a pandas object requires a py module, and qgis was trying to access it in my local python environment, ignoring its own packages. When I deleted the local python the error was gone too. I am new to qgis, so I wanted to ask if that is the intended behavior of the qgis environment? It is looking for modules that it cannot find in its own env in the other directories, is this intended or am I missing something? Thanks for the quick feedback |
Yes I assume that this is the entended behaviour but as you can see it has a lot of limitation. What I would encourage you to do is to use numpy (as pandas is a numpy wrapper in good part) or use providers, as you know one provider can support csv, so I assume that you could leverage either of those. Or if pandas is necessary you could add it to your plugin if it is not imported by another plugin. Those are just suggestion, I'm sure other devs might have better advice. What you can also do is ask on the dev mailing list. In the meantime I think you can close this ticket to migrate the discussion to a place like the mailing list or gitter (is it gitter? I can't recall). |
Sure, closing it now, thanks a lot for the info and feedback! |
A bug occurs while trying to initialise a pandas dataframe in the qgis python console. I stumbled upon it writing a plugin and needed to save data to a dataframe. Everything works fine outside the qgis environment. It occurs in any project and I have no idea what causes this.
How to Reproduce
Qgis version: 3.6, appears same in 3.8
OS: Windows 10
python: 3.7.0
pandas: 0.24.2
Opening python console in any project and trying to access a pandas dataframe results in a recursion error. Paste of the console commands run:
here is a pip freeze information from osgeo4w shell
QGIS and OS versions
I reinstalled both qgis and my local python environments a couple of times already with no impact on the issue, out of ideas about what might be the culprit here. I also tried installing a different pandas version in the shell but it had no effect either
The text was updated successfully, but these errors were encountered: