-
Notifications
You must be signed in to change notification settings - Fork 574
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
Bug when using Shapely in Windows conda #1105
Comments
@philippfischer-sd the good news is that the whole category of issues connected to loading GEOS at runtime using ctypes and libffi is going away in version 2.0. The bad news is that we're not going to do anything about this problem in 1.7 or 1.8. Meanwhile, there's a very good workaround: install shapely from conda-forge, not PyPI. |
Thanks @sgillies, unfortunately the conda workaround won't work for me, since I am releasing a PyPI package myself, which in its requirements (setup.py) has Shapely listed. |
And I've just added a long overdue question to the FAQ about this: https://github.com/Toblerity/Shapely/blob/master/FAQ.rst#i-installed-shapely-in-a-conda-environment-using-pip-why-doesnt-it-work. |
It's relatively easy to add your own package to conda-forge as well, so you your users have the option to use conda to install your package and automatically get Shapely from there as well (https://conda-forge.org/docs/maintainer/adding_pkgs.html) Further, I just made a PR with a variation of what you suggested: #1108. Testing whether that change works for your situation is very welcome. |
Awesome! Works for me. @sgillies: Is there a chance it can be included in the next version 1.8? Currently there is only an alpha version 1.8a1 |
Thanks for testing! |
Reproducing the Bug
The bug is very easy to reproduce by following these steps:
Resulting Error
How to Fix
The reason is an error in this function:
https://github.com/Toblerity/Shapely/blob/8ef5b092750e3499893f990ab6498dca17dc2c80/shapely/geos.py#L59
The function doesn't actually do what is says. It simply checks if there is a conda environment, but not if shapely is installed as a conda package or as a pip package inside that environment.
There are multiple ways to fix it:
exists_conda_env()
function to check if there actually is ashapely*.json
file in theconda-meta
folder and not just if the folder exists.The text was updated successfully, but these errors were encountered: