Lion Pham
Lion Pham

Reputation: 41

How to install pandas library in QGIS python?

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

Upvotes: 4

Views: 8697

Answers (3)

testo
testo

Reputation: 1260

Actually pandas ist installed in the environment: QGIS (3.28.15)

I am on Windows, Linux is similar.

  1. Open "OSGeo4W Shell"

You are now in the correct environment.

  1. You can now use pip to install packages, but I would not do it, cause the environment ist not project specific. In a result you can break your installation.

  2. use "pip freeze" to see what is already installed:

The environment already contains pandas, geopandas and much more gis-stuff.

C:\Program Files\QGIS 3.28.15>pip freeze

attrs==20.2.0
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
click-plugins==1.1.1
cligj==0.7.0
coverage==5.3
cycler==0.10.0
decorator==4.4.2
et-xmlfile==1.1.0
ExifRead==2.3.2
fiona==1.9.5
fonttools==4.28.5
future==0.18.2
GDAL==3.8.3
geographiclib==1.50
geopandas==0.14.1
httplib2==0.18.1
idna==2.10
importlib-metadata==2.0.0
Jinja2==3.1.2
kiwisolver==1.2.0
lxml==4.6.2
MarkupSafe==1.1.1
matplotlib==3.5.1
mock==4.0.2
networkx==2.5
nose2==0.9.2
numpy==1.24.1
openpyxl==3.0.9
OWSLib==0.29.2
packaging==20.4
pandas==2.0.2
Pillow==10.0.1
plotly==4.12.0
ply==3.11
psycopg2-binary==2.9.3
Pygments==2.7.2
pyodbc==4.0.30
PyOpenGL==3.1.5
pyparsing==2.4.7
PyPDF2==3.0.1
pypiwin32==223
pyproj==3.6.1
PyQt5==5.15.4
PyQt5-sip==12.8.1
pyserial==3.5
python-dateutil==2.8.1
pytz==2023.3
pywin32==304
PyYAML==5.3.1
remotior_sensus==0.2.1
reportlab==4.0.4
requests==2.24.0
retrying==1.3.3
scipy==1.10.1
shapely==2.0.2
simplejson==3.17.2
sip @ file:///D:/src/osgeo4w/src/python3-sip/sip-6.1.1/dist/sip-6.1.1-cp39-cp39-win_amd64.whl
six==1.15.0
toml==0.10.1
typing_extensions==4.5.0
tzdata==2023.3
urllib3==1.25.11
wxPython @ file:///D:/src/osgeo4w/src/python3-wxpython/wxPython-4.2.0/dist/wxPython-4.2.0-cp39-cp39-win_amd64.whl
xlrd==1.2.0
xlwt==1.3.0
zipp==3.4.0

Upvotes: 0

Holomorphic Guy
Holomorphic Guy

Reputation: 86

  • 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.

Upvotes: 0

luart
luart

Reputation: 1451

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.

Upvotes: 0

Related Questions