运行简单的代码打开图像后,出现以下错误:
我的系统配置文件:
64位
康达-V:康达3.14.1:Anaconda3-2.3.0-Windows-x86_64.ex
根环境:python 3.4.0
mynewenv:python 3.7.0
GDAL:GDAL-3.0.0.win-amd64-py3.4.msi
import gdal
import matplotlib.pyplot as plt
x = gdal.Open("G:\Prof_Python_Programmer\Demo_New\Band2.tif")
y = gdal.ReadAsArray()
plt.imshow(x)
runfile('C:/Users/Peyma/Documents/Python Scripts/test.py', wdir='C:/Users/Peyma/Documents/Python Scripts')
Traceback (most recent call last):
File "<ipython-input-4-aaf39f84c691>", line 1, in <module>
runfile('C:/Users/Peyma/Documents/Python Scripts/test.py', wdir='C:/Users/Peyma/Documents/Python Scripts')
File "C:\Users\Peyma\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
execfile(filename, namespace)
File "C:\Users\Peyma\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 85, in execfile
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
File "C:/Users/Peyma/Documents/Python Scripts/test.py", line 7, in <module>
import gdal
File "C:\Users\Peyma\Anaconda3\lib\site-packages\gdal.py", line 2, in <module>
from osgeo.gdal import deprecation_warn
File "C:\Users\Peyma\Anaconda3\lib\site-packages\osgeo\__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "C:\Users\Peyma\Anaconda3\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
File "C:\Users\Peyma\Anaconda3\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: DLL load failed: The specified procedure could not be found.