Installing GeoDjango dependencies on Windows 10 or Windows Server 2012 R2?
I do not see a direct question here and I am little late in answering this. Yet, I have had a hard time setting up a similar environment recently and could not find a simple solution that did not involve hacking source files... So, here is what worked for me:
- Install Python 3.6 (32 bit)
- Create a virtual environment and activate it
pip install django
pip install psycopg2
(assuming you've setup PostgreSQL)pip install GDAL-2.2.3-cp36-cp36m-win32.whl
You can get that .whl here. Take note of the warning there "Do not use together with OSGeo4W or gdalwin32".add 2 system environment variables "GDAL_DATA" and "GDAL_LIB".
- GDAL_DATA =
C:\<path_to_your>\venv\Lib\site-packages\osgeo\data\gdal
- GDAL_LIB =
C:\<path_to_your>\venv\Lib\site-packages\osgeo
- GDAL_DATA =
Then, add each variable to your system PATH like so:
%GDAL_DATA%
%GDAL_LIB%
- Restart Pycharm and Fire up the django server
This basically follows the Django docs but uses the .whl instead of OsGeo4W. Also, I did not mess with the Python path because I have ArcGIS running with Python 2.7