You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the last versions of Python it is no more possible to import the Service module of intermine, resulting in the following error:
Traceback (most recent call last): File "<ipython-input-3-b381508e45c3>", line 3, in <module> from UserDict import DictMixin File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ModuleNotFoundError: No module named 'UserDict' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3251, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-3-b381508e45c3>", line 9, in <module> from collections import MutableMapping as DictMixin ImportError: cannot import name 'MutableMapping' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
In the webservice.py file the problems are the following:
from urlparse import urlparse -> the library was moved inside urllib.parse
from UserDict import DictMixin -> no more available, use MutableMapping instead
from urllib import urlencode -> the library was moved inside urllib.parse
Modify the import section as follow solved the problem: try: import sys from urllib.parse import urlparse, urlunparse, parse_qs, urlencode from collections.abc import MutableMapping as DictMixin from collections import OrderedDict from urllib.request import urlopen except ImportError: from urllib.parse import urlparse from urllib.parse import urlencode from .odict import OrderedDict from collections import MutableMapping as DictMixin from urllib.request import urlopen
Making these changes in the source code will no longer require the intervention of a user to modify it, as it is not possible in all cases.
The text was updated successfully, but these errors were encountered:
This is what @AndreaFurlani posted, I believe (because editing the appropriate section in webservice.py worked in conjunction with Python 3.10), formatted correctly for easier pasting:
Using the last versions of Python it is no more possible to import the Service module of intermine, resulting in the following error:
Traceback (most recent call last): File "<ipython-input-3-b381508e45c3>", line 3, in <module> from UserDict import DictMixin File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) ModuleNotFoundError: No module named 'UserDict' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3251, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-3-b381508e45c3>", line 9, in <module> from collections import MutableMapping as DictMixin ImportError: cannot import name 'MutableMapping' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
In the webservice.py file the problems are the following:
Modify the import section as follow solved the problem:
try: import sys from urllib.parse import urlparse, urlunparse, parse_qs, urlencode from collections.abc import MutableMapping as DictMixin from collections import OrderedDict from urllib.request import urlopen except ImportError: from urllib.parse import urlparse from urllib.parse import urlencode from .odict import OrderedDict from collections import MutableMapping as DictMixin from urllib.request import urlopen
Making these changes in the source code will no longer require the intervention of a user to modify it, as it is not possible in all cases.
The text was updated successfully, but these errors were encountered: