3

I'm developing a QGIS Plugin with python. I need to do a request to a REST server. But when I try to use request module "No module named requests" error displayed.

requests module is installed in my system, but I don't know why QGIS doesn't detect it.

What can I do?

My SO is Windows 7 Ultimate, and QGIS version installed is 2.14.3

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Sergio
  • 31
  • 1
  • 2
  • 2
    Ignore QGIS for a moment. What happens when you do a import requests using a python command line? – BradHards Aug 01 '16 at 11:21
  • In a python comand line I can import requests without problem, but in QGis python console the error is: Traceback (most recent call last): File "<input>", line 1, in <module> File "C:/****/***/apps/qgis/./python\qgis\utils.py", line 572, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ImportError: No module named requests Same as plugin error. – Sergio Aug 02 '16 at 13:43
  • Are you sure the commad line Python is in the same place as the one QGIS uses? On windows, QGIS has its own python version, while there may be another in your PATH as well to be used outside QGIS. – AndreJ Aug 03 '16 at 12:57

2 Answers2

1

You need install the missing library in the qgis path.

enter image description here

And that is installed correctly,on the osgeo4W shell ,write this pip list.

enter image description here

And ,after start qgis and check that is intalled correctly,with import requests

Fran Raga
  • 7,838
  • 3
  • 26
  • 47
0

It appears that the requests package isn't installed for the python instance used by QGIS. Please see this question for tips on how to install python packages for QGIS.

metasequoia
  • 559
  • 5
  • 17