mauroalberti / qProf

Python plugin for QGIS, to create topographic and geological profiles
GNU General Public License v3.0
24 stars 3 forks source link

No module named urllib.request #6

Closed L-I-S-T-A closed 6 years ago

L-I-S-T-A commented 6 years ago

I cannot install qProf plugin, I receive the message: "ImportError: No module named urllib.request". In the directory "Python36" there are the directories and file "Python36\Lib\urllib\request.py"! Where could be the problem?

mauroalberti commented 6 years ago

But from your message I understand that you are using Python 3.6. qProf is currently just for QGIS 2.x, that uses Python 2.7 or however 2.x. Even if you have both Python 3 .x and 2.x, and your QGIS is using (as expected) Python 2.x, urlib is a standard library module, so it should be already available in your Python 2.x.

Which OS and QGIS version are you using? And how did you try to install qProf? From the QGIS Python plugin manager or in any other way?

L-I-S-T-A commented 6 years ago

I'm using Windows 10 and QGIS 2.18.14 and QGIS 2.14.20. I installed qProf from Python plugin manager. In Python 2.x I don't find urllib. I find only urllib3 directory in the path: ...\Lib\site-packages\ and the file request.py in this directory.

Giulio F. Pappafico

http://listauniurb.jimdo.com/ Skype: pappafico2

2017-11-19 19:09 GMT+01:00 alberese notifications@github.com:

But from your message I understand that you are using Python 3.6. qProf is currently just for QGIS 2.x, that uses Python 2.7 or however 2.x. Even if you have both Python 3 .x and 2.x, and your QGIS is using (as expected) Python 2.x, urlib is a standard library module, so it should be already available in your Python 2.x.

Which OS and QGIS version are you using? And how did you try to install qProf? From the QGIS Python plugin manager or in any other way?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mauroalberti/qProf/issues/6#issuecomment-345537174, or mute the thread https://github.com/notifications/unsubscribe-auth/AHRrXGebFkd6qE8I4LVeEqbj9xArsSjJks5s4G7ogaJpZM4QjcyZ .

mauroalberti commented 6 years ago

In qProf the only use of an internet-related module should be for opening the help html file. But the used module is webbrowser, not urllib. And also webbrowser is a standard library Python module, so it should be there. Would it be possible to look at the full stack of error-messages, that ends with "ImportError: No module named urllib.request", to understand where and why urllib is called? Moreover, when typing in the QGIS Python console: import webbrowser webbrowser.open("http://www.google.com") what are the results?

L-I-S-T-A commented 6 years ago

Sorry for the delay of my answer, I completely reinstalled QGIS and the various requested packages and now qProf runs regularly.

Thank you very much for your help and for the suggestions.

Giulio

2017-11-20 22:33 GMT+01:00 alberese notifications@github.com:

In qProf the only use of an internet-related module should be for opening the help html file. But the used module is webbrowser, not urllib. And also webbrowser is a standard library Python module, so it should be there. Would it be possible to look at the full stack of error-messages, that ends with "ImportError: No module named urllib.request", to understand where and why urllib is called? Moreover, when typing in the QGIS Python console: import webbrowser webbrowser.open("http://www.google.com http://www.google.com") what are the results?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mauroalberti/qProf/issues/6#issuecomment-345838994, or mute the thread https://github.com/notifications/unsubscribe-auth/AHRrXKvdNv8pm9h_C9jqAtDtXxpspAVOks5s4fA2gaJpZM4QjcyZ .

mauroalberti commented 6 years ago

Good that you solved the problem...

mauro