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

Possibility to install python packages with C extensions #128

Open
joaoponceleao opened this issue May 24, 2021 · 3 comments
Open

Possibility to install python packages with C extensions #128

joaoponceleao opened this issue May 24, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@joaoponceleao
Copy link

Hi,

Following the inclusion of pip (thanks!), we are now faced with problem of failed installations of python packages that include C extensions. When installing, pip complains about a missing header file "Python.h". On Linux, this normally requires an install of "python-dev". On Mac (and Windows?), this is normally included in the python package from most sources.

It would be great if this could be included in QGIS. There are two workarounds I can think of for the time being, but neither is ideal.

At the moment, the workaround I have is to include my particular Homebrew python in the C_INCLUDE_PATH of the system environment variables. It seems to take care of the issue, and the QGIS pip installs the package without complaints. This works nicely for development but is not ideal for end-users.

Another workaround, which would be easier when distributing plugins that require such packages, is to ask the end user to install the required python dependencies in a separate python installation (from homebrew, conda, or python.org). I should just be able to add that site-packages directory to the top of my QGIS python plugin. The problem in this case, is having to add multiple site-packages dir sources to the top of the file, since there is no way of knowing which python the user installed, and where.

Would be great to hear your thoughts on this.

Many thanks,

Joao

@PeterPetrik
Copy link
Contributor

which python package you want to install in the first place?

@PeterPetrik PeterPetrik added the enhancement New feature or request label May 24, 2021
@joaoponceleao
Copy link
Author

This happened with triangle (https://pypi.org/project/triangle/). Not sure what other packages have this requirement (there does not seem to be a list of these online).

@tdanckaert
Copy link

I have the same issue trying to install the RichDEM package (https://richdem.readthedocs.io/en/latest/)... basically any package that requires building a C extension module (there are many) will meet this problem? Including header files in /Applications/QGIS.app/Contents/MacOS/include/pythonx.y would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants