While there are tools and methods for qgis 2 i cannot figure out for 3 I want to install external python packages such as sqlalchemy etc

I tried the following things :

  1. Tried to download osgeo4w for qgis 3.02 as of now there is no advance installation option like it use to be before http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe .

  2. Tried to install setuptools but its not working in the 2nd step. it returns 1. https://www.lutraconsulting.co.uk/blog/2016/03/02/installing-third-party-python-modules-in-qgis-windows/

  3. Went to python of the C:\Program Files\QGIS 3.0\bin and tried pip but it does not work


I encounter that problem after installing QGIS 3, too. Therefore, I install Python packages in following way:

  1. Copy python3.dll and python36.dll in (QGIS_PATH)/bin folder to (QGIS_PATH)/apps/Python36/ folder.
  2. Open command prompt as administrator. Go to Python36 folder. cd c:/(QGIS_PATH)/apps/Python36
  3. Install Pyhon packages by python -m pip install package_name.

I use that way, because I couldn't install packages using OSGeo Shell. When I try in OSGeo Shell, Python crashes.

EDIT: This was one solution that I was using. But OSGeo4W shell with python3 post as @Luke states in comment has exact solution.

  • 1
    Did you set up your python 3 environment properly by running the py3_env command? gis.stackexchange.com/a/277842/2856 – user2856 May 13 '18 at 10:33
  • No. After copying files, I just opened windows command prompt, and run python -m pip install PACKAGE in Python36 folder. When I tried same steps in OSGeo Shell, I failed. – Kadir Şahbaz May 13 '18 at 10:46
  • @Luke I get it now. But why is it default setting. Because of Python 2? – Kadir Şahbaz May 15 '18 at 13:33
  • Probably because QGIS 2.18 is the long-term support version and requires Python 2 so they make that the default – user2856 May 15 '18 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.