-
Notifications
You must be signed in to change notification settings - Fork 124
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
rtree/core not detecting conda environment #143
Comments
A temporary hack is to simply
before importing geopandas or rtree |
I don't run Conda, but have you tried |
Not much there.
Not necessarily, you can create a Conda environment with an arbitrary prefix. In our case:
|
I wonder if we don't need this at all. Newer ctypes.find_library should resolve the library just fine without the special compensation for Conda's paths. |
Ok, I did a bunch of rummaging and figured this out. ctypes significantly changed how LoadLibrary does DLL finding in Python 3.8. In short, applications are supposed add DLL search paths themselves now, instead of being implicitly added via PATH. The previous conda hack was a symptom of that problem, where we were trying to give a full path to the DLL. I still need to do some research how to appropriately do this without wrecking DLL resolution for other applications, but at least I know what this problem is now. |
Here's what conda is doing to the DLL loading environment |
If you do |
conda-forge/python-feedstock#307 also describes what is going on. |
I'm using Conda on Windows 10 and getting the following error on import (of geopandas)
OSError: could not find or load spatialindex_c-64.dll
The error originates from line 117 in core.py:
the problem is that sys.version evaluates to
'3.8.1 (default, Jan 8 2020, 15:55:49) [MSC v.1916 64 bit (AMD64)]'
so it seems like checking for the presence of 'conda' in sys.version may not be a reliable way to detect being in a Conda environment.
Maybe the better solution is to check if 'os.path.join(sys.prefix, "Library", "bin")' exists, or to change the entire logic to
Thanks,
-nick
The text was updated successfully, but these errors were encountered: