[英]How can i install gdal for python in windows 10?
I'm trying to install gdal library.我正在尝试安装 gdal 库。 i've tried the things recomended here Installing gdal python library on windows using conda (DLL load failed)
我已经尝试过这里推荐的东西使用 conda 在 Windows 上安装 gdal python 库(DLL 加载失败)
and here: https://github.com/felipunky/GISPython/blob/master/README.md在这里: https : //github.com/felipunky/GISPython/blob/master/README.md
then i tried:然后我尝试:
C:\Users\User>pip install D:\Seba\Programas\GDAL-3.3.0-cp37-cp37m-win_amd64.whl
Requirement already satisfied: GDAL==3.3.0 from file:///D:/Seba/Programas/GDAL-3.3.0-cp37-cp37m-win_amd64.whl in c:\users\user\appdata\local\programs\python\python37\lib\site-packages (3.3.0)
WARNING: You are using pip version 20.1.1; however, version 21.1.2 is available.
You should consider upgrading via the 'c:\users\user\appdata\local\programs\python\python37\python.exe -m pip install --upgrade pip' command.
C:\Users\User>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'gdal'
>>> from osgeo import gdal
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\osgeo\__init__.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
File "<frozen importlib._bootstrap>", line 583, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1043, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: No se puede encontrar el módulo especificado.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\osgeo\__init__.py", line 34, in <module>
_gdal = swig_import_helper()
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\osgeo\__init__.py", line 31, in swig_import_helper
return importlib.import_module('_gdal')
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_gdal'
>>>
any recomendation?有什么建议吗?
Thanks谢谢
试试这个: sudo easy_install GDAL
conda install of gdal in windows does work.在 Windows 中 conda 安装 gdal 确实有效。
You haven't given much to go on, but my guess is that you have not activated the conda environment into which gdal has been installed.您没有做太多事情,但我的猜测是您还没有激活安装了 gdal 的 conda 环境。
Normally your command prompt would look like this, if you had activated it通常你的命令提示符看起来像这样,如果你已经激活它
(gdal_env_name) C:\Users\User>python
Also, run另外,运行
conda list
to check that all the expected libraries are there.检查所有预期的库是否都在那里。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.