Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'Sequence' from 'collections' #1930

Closed
thegarlynch opened this issue Oct 13, 2021 · 13 comments
Closed

ImportError: cannot import name 'Sequence' from 'collections' #1930

thegarlynch opened this issue Oct 13, 2021 · 13 comments

Comments

@thegarlynch
Copy link

Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Guake.

For how to run the latest Guake in your computer, please refer to Install from source.

Describe the bug

Traceback (most recent call last):
File "/usr/sbin/guake", line 10, in
sys.exit(exec_main())
File "/usr/lib/python3.10/site-packages/guake/main.py", line 614, in exec_main
if not main():
File "/usr/lib/python3.10/site-packages/guake/main.py", line 440, in main
from guake.dbusiface import DBUS_NAME
File "/usr/lib/python3.10/site-packages/guake/dbusiface.py", line 25, in
import dbus.service
File "/usr/lib/python3.10/site-packages/dbus/service.py", line 35, in
from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib/python3.10/collections/init.py)

A clear and concise description of what the bug is.

Expected behavior

A clear and concise description of what you expected to happen.

Actual behavior

What you actually get.

To Reproduce

Provide the steps to reproduce the behavior

open guake in python3.10


Please run $ guake --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting. And make sure you run the command OUTSIDE the Guake.

$ guake --support

Guake Version: 3.7.0

Vte Version: 0.64.2

Vte Runtime Version: 0.64.2


GTK+ Version: 3.24.30

GDK Backend: gi.GdkWaylandDisplay


Desktop Session: gnome


Display: wayland-0

RGBA visual: True

Composited: True

  • Monitor: 0 - CMN 0x14e3
    • Geometry: 1366 x 768 at 0, 0
    • Size: 310 x 170 mm²
    • Primary: False
    • Refresh rate: 60.00 Hz
    • Subpixel layout: unknown
@Davidy22
Copy link
Collaborator

The last line says that the error's coming out of dbus. Looks like dbus-python on pypi hasn't uploaded the version that they say is updated for python 3.10 yet as well. Their pypi page does seem to suggest that we should use another python library, so switching to one of those shiny new options could be a thing too, would mean one more dependency on pure pypi too. I've made an issue on dbus-python's issue tracker to prompt them to update pypi, but until they update or we move away from dbus Guake does not yet support python 3.10.

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 14, 2021

Went googling a little and this dbus option seems fun, I'll try swapping this in sometime, see how it runs.

@Davidy22
Copy link
Collaborator

Alright, dbus-python updated their pypi version to latest, can you do a pip install --upgrade dbus-python and try again on python 3.10?

@Davidy22
Copy link
Collaborator

Oh, did it work?

@thegarlynch
Copy link
Author

Yeah. upgrading dbus-python worked

@PratyushBasu
Copy link

PratyushBasu commented Dec 9, 2021

I'm unable to install/upgrade 'dbus-python' n Windows OS.
Error:

error: [WinError 193] %1 is not a valid Win32 application
  ----------------------------------------
  ERROR: Failed building wheel for dbus-python
  Running setup.py clean for dbus-python
Failed to build dbus-python
Installing collected packages: dbus-python
    Running setup.py install for dbus-python ... error
    ERROR: Command errored out with exit status 1:

Does this 'dbus-python' work in Windows OS also?
If not does anyone know the workaround?
Thanks in advance.

@Davidy22
Copy link
Collaborator

Davidy22 commented Dec 9, 2021

dbus is a library for connecting to a linux service. I was unaware that Guake worked on windows, have you been able to install it before?

@dongyangTHU
Copy link

Hi, I meet this problem:
Exception in thread django-main-thread: Traceback (most recent call last): File "/root/miniconda3/envs/mne/lib/python3.10/threading.py", line 1009, in _bootstrap_inner self.run() File "/root/miniconda3/envs/mne/lib/python3.10/threading.py", line 946, in run self._target(*self._args, **self._kwargs) File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 124, in inner_run self.check(display_num_errors=True) File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/core/management/base.py", line 438, in check all_issues = checks.run_checks( File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/core/checks/registry.py", line 77, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/core/checks/urls.py", line 23, in check_resolver return check_method() File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/urls/resolvers.py", line 446, in check for pattern in self.url_patterns: File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/urls/resolvers.py", line 632, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/django/urls/resolvers.py", line 625, in urlconf_module return import_module(self.urlconf_name) File "/root/miniconda3/envs/mne/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/ubuntu/dongyang/mysite/urls.py", line 18, in <module> from upload.views import index File "/home/ubuntu/dongyang/upload/views.py", line 10, in <module> import SplcV3 File "/home/ubuntu/dongyang/codes/SplcV3.py", line 10, in <module> from surfer import Brain #用于可视化大脑皮层表面的三维网格上绘制数据 File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/surfer/__init__.py", line 1, in <module> from .viz import Brain, TimeViewer # noqa File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/surfer/viz.py", line 25, in <module> from . import utils, io File "/root/miniconda3/envs/mne/lib/python3.10/site-packages/surfer/utils.py", line 1, in <module> from collections import Sequence ImportError: cannot import name 'Sequence' from 'collections' (/root/miniconda3/envs/mne/lib/python3.10/collections/__init__.py)

have no idea why this occurs

@aussieklutz
Copy link

@dongyangTHU - You have asked about an error in a completely different project. This project has found a solution for it, but you likely need to go and check with the developers of whatever project you are using.

@dsaichand3
Copy link

Upgrading to the latest version of the pip worked for me.

@Guan-Smile
Copy link

Guan-Smile commented Aug 18, 2022

In python3.10
change from collections import Sequence to from collections.abc import Sequence
It works!
wireservice/agate#737

@GOLD106
Copy link

GOLD106 commented Oct 10, 2022

Exception ignored in thread started by: <function check_errors..wrapper at 0x000001BB6B0E9480>
Traceback (most recent call last):
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 248, in raise_last_exception
raise exception[1]
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management_init
.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\django_init_.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in load_unlocked
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\corsheaders_init
.py", line 1, in
from .checks import check_settings # noqa: F401
File "C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\site-packages\corsheaders\checks.py", line 2, in
from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\Users\GOLD\AppData\Local\Programs\Python\Python310\lib\collections_init
.py)

I have add the corsheader in setting.py
But I can see like this error.
How can I solve this error?

@GOLD106
Copy link

GOLD106 commented Oct 10, 2022

I have sent axios post request from reawct.js frontend to Django Backend.
Because there is cors error, I have add the corsheader in Dhango.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants