-
Notifications
You must be signed in to change notification settings - Fork 43
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
Failure to install on 64-bit Windows 10 system, and Python version 3.8.10 #92
Comments
@richiy would you please provide some details on your system/setup? For now, detectree2 has only been tested on Linux and in Colab notebooks so we would recommend either of those if available to you. |
Ok,thanks! |
Installing on windows can be a bit tricky. Try
GDAL (Geospatial Data Abstraction Library) is a translator library for raster and vector geospatial data formats and is necessary for rasterio to function. You can install it with conda, an open-source package management system and environment management system.
If you are not using Anaconda, you can download precompiled binaries for GDAL from GIS Internals.
After GDAL is installed, you need to add GDAL to your system's PATH and set the GDAL_CONFIG environment variable. This variable should point to the gdal-config script that was installed with GDAL. The GDAL installation path will likely be something like C:\Program Files\GDAL. You should add C:\Program Files\GDAL to your PATH and set GDAL_CONFIG=C:\Program Files\GDAL\gdal-config. If you can't find gdal-config (which can happen with some installations), then try setting the GDAL_VERSION environment variable to the version of GDAL you installed (like GDAL_VERSION=2.2.3). You can set these variables in the "Environment Variables" section of your system settings on Windows, or you can set them in your shell before running pip:
Try installing rasterio with conda: Since rasterio and GDAL can be tricky to install with pip on Windows, an easier option might be to just install rasterio with conda, which will also automatically handle the GDAL dependency:
Please ensure that you replace the paths in the solutions above with the correct paths from your local system |
Hi, I had the same issue on a Windows computer with Python version 3.10, but following these steps got me past this first error. However, now I get the following new errors during the installation of detectree2: rasterio/_base.c(768): fatal error C1083: Cannot open include file: 'cpl_conv.h': No such file or directory error: could not create 'build\temp.win-amd64-cpython-310\Release\Users\xxx\AppData\Local\Temp\pip-install-unq9wwxu\detectron2_2daef03b29624941b7c8c5c6518219d5\detectron2': The filename or extension is too long Successfully built detectree2 Any suggestions on how to solve this? |
I got the exact same error about rasterio but managed to build detectron2 by using: pip install git+https://github.com/facebookresearch/detectron2.git@5aeb252b194b93dc2879b4ac34bc51a31b5aee13 I had to use: pip install rasterio though as using: conda install -c conda-forge rasterio was getting stuck at solving the environments. |
I also had this problem before. Then I went through a series of experiments, and it worked. I didn't use the python environment directly but instead used anaconda. Here are the specifications of the system I used:
Here are the steps I've done:
|
Collecting rasterio==1.3a3
Using cached rasterio-1.3a3.tar.gz (401 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\xxxx\AppData\Local\Programs\Python\Python38\python.exe' 'C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\pip_vendor\pep517\in_process_in_process.py' get_requires_for_build_wheel 'C:\Users\xxxx\AppData\Local\Temp\tmprw8grws6'
cwd: C:\Users\xxxx\AppData\Local\Temp\pip-install-ozyk4_bv\rasterio_97d0b87c61a740218c42e09690312378
Complete output (2 lines):
INFO:root:Building on Windows requires extra options to setup.py to locate needed GDAL files. More information is available in the README.
ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
The text was updated successfully, but these errors were encountered: