Skip to content
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

Bad_alloc with pyroj import in QGIS plugin #1414

Closed
phorgue opened this issue Jul 4, 2024 · 1 comment
Closed

Bad_alloc with pyroj import in QGIS plugin #1414

phorgue opened this issue Jul 4, 2024 · 1 comment
Labels
installation-issues Issue related to installation problems. wontfix

Comments

@phorgue
Copy link

phorgue commented Jul 4, 2024

Problem description

The following error may occur when trying to import pyproj into a QGIS plugin

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Abandon (core dumped)

I was able to identify that this error only occurs when the pyproj package has been installed using pip

The error does not occur if the package has been installed using a package manager, for example for ubuntu

sudo apt install python3-pyproj

This error was observed on several versions of linux (ubuntu/fedora) and on different versions of QGIS (3.28/ 3.34).
There doesn't seem to be any link with the pyproj version (installing an identical or more recent version using pip systematically causes the error)

To reproduce

Simply add :

import pyproj

to a plugin QGIS source files and install pyproj using pip. QGIS should stop while loading the plugin with the bad_alloc error.

@phorgue phorgue added the bug label Jul 4, 2024
@snowman2 snowman2 added installation-issues Issue related to installation problems. help wanted labels Jul 5, 2024
@rouault
Copy link

rouault commented Oct 26, 2024

I was able to identify that this error only occurs when the pyproj package has been installed using pip

fully expected and nothing one can do about, expect: never use pip with binary wheels, but in trivial use cases. And QGIS is not a trivial use case. The issue here is that pyproj installed through pip goes with its own libproj that conflicts with the libproj used by QGIS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation-issues Issue related to installation problems. wontfix
Projects
None yet
Development

No branches or pull requests

3 participants