【问题标题】:How to install pandas library in QGIS python?如何在 QGIS python 中安装 pandas 库?
【发布时间】:2019-10-10 03:15:19
【问题描述】:

我正在构建一个 QGIS plugin 并使用 Python Pandas 库。如何在 QGIS python 中安装 Pandas 库?请帮帮我!

【问题讨论】:

  • 欢迎来到stackoverflow。检查这个site
  • 这可能很棘手,因为 QGIS python 不是最新的。但是试试这个,我按照分步指南安装了 PySAL 库。 Check this guide

标签: python pandas qgis


【解决方案1】:

有很多方法:

  1. 为您的 Python 版本安装 piphttps://pip.pypa.io/en/latest/installing.html

    $ wget https://bootstrap.pypa.io/get-pip.py
    $ sudo python get-pip.py

然后安装pandas:$ sudo pip install pandas

  1. 从源代码安装 pandas: http://pandas.pydata.org/getpandas.html 编译它并将包复制到您的PYTHON_PATH

【讨论】:

  • 感谢 luart,我在 Windows 上使用 QGIS,而不是 linux。可以用windows指导吗?
  • 在 Python 中使用 pip 安装模块没有区别,因为 Python 代码是跨平台的,C 库是从源代码编译的。所以它应该像上面描述的那样工作,你应该使用一些浏览器而不是 wget 下载 get-pip.py 并有一些 C 编译器(VC 等)在这里查看详细信息:stackoverflow.com/questions/4750806/… sudo 应该被省略,即从 Windows 终端使用 python get-pip.pypip install pandas(你的 python 应该在系统路径中)。
【解决方案2】:
  • 导航到C:\QGIS\apps\Python27\C:\QGIS\apps\Python37
  • 在按住shift 的同时右键单击并在此处打开命令提示符或powershell。
  • 输入python -m pip install pandas

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-21
    • 2012-07-21
    • 1970-01-01
    • 2022-01-10
    • 2014-01-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多