4

I'm building a QGIS plugin and using Python Pandas library. How to install Pandas library in QGIS python? Please help me !

Kousik
  • 21,485
  • 7
  • 36
  • 59
Lion Pham
  • 41
  • 1
  • 3
  • 1
    Welcome to stackoverflow. Check this [site](http://gis.stackexchange.com/questions/134267/how-do-i-install-a-external-package-in-qgis) – R.Katnaan Jul 21 '15 at 07:18
  • This could be tricky as QGIS python isn't up to date. But try this, I installed PySAL library with the step by step guide. [Check this guide](http://umar-yusuf.blogspot.com.ng/2016/07/How-to-Install-Third-party-Python-Modules-in-QGIS-Windows.html) – Umar Yusuf Jul 31 '16 at 16:11

2 Answers2

1

There are many ways:

  1. Install pip for your version of Python: https://pip.pypa.io/en/latest/installing.html

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

Then install pandas: $ sudo pip install pandas

  1. Install pandas from source: http://pandas.pydata.org/getpandas.html compile it and copy the package to your PYTHON_PATH.
luart
  • 1,383
  • 1
  • 18
  • 25
  • Thanks luart, I'm using QGIS on windows, not linux. Can you guide with windows ? – Lion Pham Jul 21 '15 at 08:37
  • There is no difference when you install modules in Python using pip, because Python code is cross-platform and C libs are compiled from source. So it should work as describe above, you just should download the `get-pip.py` using some browser instead of the `wget` and have some C compiler (VC or etc.) See details here: https://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows `sudo` should be just omitted, i.e. use `python get-pip.py` and `pip install pandas` from Windows terminal (your python should be in the system PATH). – luart Jul 21 '15 at 18:13
0
  • Navigate to C:\QGIS\apps\Python27\ or C:\QGIS\apps\Python37.
  • Right click while holding shift and open command prompt or powershell here.
  • Type python -m pip install pandas.