简体   繁体   English

Python Visual Studio的gdal安装

[英]gdal installation for Python Visual Studio

I want to develop GIS based GUI in python using Visual Studio 2013. 我想使用Visual Studio 2013在python中开发基于GIS的GUI。

But when I am trying to using gdal it is showing error given below- 但是当我尝试使用gdal时,它显示以下错误-

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named gdal

It would be helpful, if you let me know how to install gdal for python? 如果您让我知道如何为python安装gdal会很有帮助?

I am using Visual studio 2013 for python. 我正在使用Visual Studio 2013 for python。

For windows, you may download from here. 对于Windows,您可以从此处下载

  1. Add the installation directory bin folder to your system PATH, remember to put a semicolon in front of it before you add to the existing path. 将安装目录bin文件夹添加到系统PATH中,在添加到现有路径之前,切记在其前面放置一个分号。

     C:\\gdalwin32-1.6\\bin 
  2. Create a new user or system variable with the data folder from your installation. 使用安装中的数据文件夹创建一个新的用户或系统变量。

     Name : GDAL_DATA Path : C:\\gdalwin32-1.6\\data 

If you don't know how to do this, than suggested Microsoft KnowledgeBase documentation 如果您不知道如何执行此操作,则建议使用Microsoft KnowledgeBase文档

For more details you may take look here for other platforms. 有关更多详细信息,请在此处查看其他平台。

You should be able to install the components for various versions of MSVC and Python at this website: 您应该可以在以下网站上安装适用于各种版本的MSVC和Python的组件:

http://www.gisinternals.com/ http://www.gisinternals.com/

I've only used the above resource for running GDAL under Python. 我仅使用以上资源在Python下运行GDAL。 I've never used Visual Studio 2013 for Python, but hopefully the above resource provides the necessary components. 我从未使用过Visual Studio 2013 for Python,但希望以上资源提供了必要的组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM