nextgis / quickmapservices

QGIS plugin to find and add map services to a project in one click
http://plugins.qgis.org/plugins/quick_map_services/
GNU General Public License v2.0
170 stars 49 forks source link

Cannot get contributed pack: 'sys' has no attribute 'exc_type' #180

Closed p-a-s-c-a-l closed 3 years ago

p-a-s-c-a-l commented 5 years ago

The following exception is thrown when trying to get the contributed pack:

AttributeError: module 'sys' has no attribute 'exc_type'

Traceback (most recent call last):
  File "C:/Users/pd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\settings_dialog.py", line 127, in get_contrib
    ExtraSources().load_contrib_pack()
  File "C:/Users/pd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\extra_sources.py", line 87, in load_contrib_pack
    self._download_file(CONTRIBUTE_ZIP_DIRECT_URL, zip_file_path)
  File "C:/Users/pd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\extra_sources.py", line 116, in _download_file
    reply = self.__sync_request(url)
  File "C:/Users/pd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\extra_sources.py", line 145, in __sync_request
    raise Exception(error)
Exception: 99

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/pd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\settings_dialog.py", line 135, in get_contrib
    error_message = self.tr('Error on getting contrib pack: %s %s') % (sys.exc_type, sys.exc_value)
AttributeError: module 'sys' has no attribute 'exc_type'

Python-Version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] QGIS-Version: 3.4.1-Madeira Madeira, 383851c597

p-a-s-c-a-l commented 5 years ago

Tried a re-install of the extension in qGIS 3.4.2 and encountered the following error:

Could not load extension 'quick_map_services' due to error calling classFactory() method

TypeError: 'QVariant' object is not subscriptable 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python\qgis\utils.py", line 335, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/pd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\__init__.py", line 35, in classFactory
    return QuickMapServices(iface)
  File "C:/Users/pd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\quick_map_services.py", line 72, in __init__
    self.locale = Locale.get_locale()
  File "C:/Users/pd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\plugin_locale.py", line 30, in get_locale
    return QSettings().value('locale/userLocale')[0:2]
TypeError: 'QVariant' object is not subscriptable

Python-Version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] QGIS-Version: 3.4.2-Madeira Madeira, 22034aa070

tatva181 commented 5 years ago

Any luck?? @p-a-s-c-a-l

Lallimost commented 5 years ago

I have the same problem:

AttributeError: module 'sys' has no attribute 'exc_type' Traceback (most recent call last): File "C:/Users/mostarda/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\settings_dialog.py", line 127, in get_contrib ExtraSources().load_contrib_pack() File "C:/Users/mostarda/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\extra_sources.py", line 87, in load_contrib_pack self._download_file(CONTRIBUTE_ZIP_DIRECT_URL, zip_file_path) File "C:/Users/mostarda/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\extra_sources.py", line 116, in _download_file reply = self.sync_request(url) File "C:/Users/mostarda/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\extra_sources.py", line 145, in sync_request raise Exception(error) Exception: 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:/Users/mostarda/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\quick_map_services\settings_dialog.py", line 135, in get_contrib error_message = self.tr('Error on getting contrib pack: %s %s') % (sys.exc_type, sys.exc_value) AttributeError: module 'sys' has no attribute 'exc_type'

Versione Python: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] Versione di QGIS: 3.4.4-Madeira Madeira, f6ddc62fdb

jonnyforestGIS commented 5 years ago

Hi guys,

Windows 10 Home 64-bits Tested in QGIS 3.4.5 Madeira LTR - Not OK Tested in QGIS 3.6 Noosa - Not OK

This is broken for Windows QGIS Installer.

Linux Kubuntu 64-bits - OK

Beside of this error as a workaround, you can open qms toolbox and access to the services and add the maps.

datapolitan commented 5 years ago

Beside of this error as a workaround, you can open qms toolbox and access to the services and add the maps.

Hi @jonnyforestGIS, I'm having the same issue with Windows 7 machines and can't find any reference to the qms toolbox you reference. Can you please provide a link to some documentation or a tutorial on how to implement this workaround to "access to the services and add the maps"?

kmezhoud commented 4 years ago

Hi, I tried to install QuickMapServices in OSX 10.15.2 through plugin manager setting. It returns a log error message: unavailable https://plugins.qgis.org/plugins/plugins.xml I have to load the zip and install it manually.

During default setting of QuickMapServices by:

Web > QuickMapServices Settings > More services > Get contributed pack

I got this error message:

AttributeError: module 'sys' has no attribute 'exc_type'
    Traceback (most recent call last):
      File "/Users/Mezhoud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/quick_map_services/settings_dialog.py", line 127, in get_contrib
        ExtraSources().load_contrib_pack()
      File "/Users/Mezhoud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/quick_map_services/extra_sources.py", line 87, in load_contrib_pack
        self._download_file(CONTRIBUTE_ZIP_DIRECT_URL, zip_file_path)
      File "/Users/Mezhoud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/quick_map_services/extra_sources.py", line 116, in _download_file
        reply = self.__sync_request(url)
      File "/Users/Mezhoud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/quick_map_services/extra_sources.py", line 145, in __sync_request
        raise Exception(error)
    Exception: 99

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Users/Mezhoud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/quick_map_services/settings_dialog.py", line 135, in get_contrib
        error_message = self.tr('Error on getting contrib pack: %s %s') % (sys.exc_type, sys.exc_value)
    AttributeError: module 'sys' has no attribute 'exc_type'

    Python version: 3.7.3 (default, Mar 27 2019, 09:23:15) [Clang 10.0.1 (clang-1001.0.46.3)] 
    QGIS version: 3.10.2-A Coruña A Coruña, 616ad4531b 

    Python Path:
    /Applications/QGIS3.10.app/Contents/MacOS/../Resources/python
    /Users/Mezhoud/Library/Application Support/QGIS/QGIS3/profiles/default/python
    /Users/Mezhoud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
    /Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins
    /Applications/QGIS3.10.app/Contents/Resources/python
    /Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/lib-dynload
    /Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/site-packages
    /Users/Mezhoud/Library/Python/3.7/lib/python/site-packages
    /Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7
    /Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python37.zip
    /Applications/QGIS3.10.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/site-packages/geos
    /Users/Mezhoud/Library/Application Support/QGIS/QGIS3/profiles/default/python 
aledalla commented 4 years ago

The problem still occur in the last versions of QGIS. I have some machines and I get the error only on Windows 7; in Windows 10 it seems work. I Can't get ride of this.. Someone of nextgis developers could help? P.S. Sorry for my bad english

tatva181 commented 4 years ago

Hi Aledalla,

We have faced such issue in the beginning of application setup and it was coming due to proxy settings, in case if the proxy setting are not configured properly then it will not allow us to download the contributed pack.

Best Regards,

JAYDEEP CHAVDA

Email Id: jaydeep.chavda@tatvasoft.com

Skype Id: tatva181

From: aledalla [mailto:notifications@github.com] Sent: Thursday, June 18, 2020 7:08 PM To: nextgis/quickmapservices Cc: Jaydeep Chavda; Comment Subject: Re: [nextgis/quickmapservices] Cannot get contributed pack: 'sys' has no attribute 'exc_type' (#180)

The problem still occur in the last versions of QGIS. I have some machines and I get the error only on Windows 7; in Windows 10 it seems work. I Can't get ride of this.. Someone of nextgis developers could help? P.S. Sorry for my bad english

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nextgis/quickmapservices/issues/180#issuecomment-646022532 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG7S37YQG7633CANAA5YBDRXIKERANCNFSM4GG5MGTA . https://github.com/notifications/beacon/ABG7S35OPFXXCSVEVBTN7ADRXIKERA5CNFSM4GG5MGTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE2AYLBA.gif

aledalla commented 4 years ago

Thank you tatva181,

As you suggested, the problem is related to proxy. I tried to not proxy the connection and everithing was fine, I will find out what is wrong on my corporate proxy; maybe you can give me some hints about how the requests are made when downloading the contribute pack.

If anyone still have this problem I suggest to investigate on that.

514ckw4r3 commented 3 years ago

Fixed in version 0.19.24. The fix will be available for download in the next release.

CriticalWill commented 1 year ago

QGIS 3.28.8 receiving same error. Windows 10 OS, no proxy