question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name 'Logger' from 'loguru'

See original GitHub issue
from logure import Logger

def f(log:Logure):
    pass

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Delgancommented, Jan 22, 2020

@heckad Which Python version are you using? I think you may need to use string literals:

import loguru

def f(log: "loguru.Logger"):
    pass
1reaction
heckadcommented, Jan 23, 2020

I use the latest version of python (3.8.1). String literal work fine. Thank you very much for the help

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: cannot import name 'getLogger' - Stack Overflow
The problem is that you've named your file 'logging.py' which makes it look like the Python native 'logging' module. When you run the...
Read more >
loguru Documentation - Read the Docs
this is why you don't need named loggers. You should not instantiate a Logger by yourself, use from loguru import logger instead.
Read more >
Cannot import Logger : r/learnpython - Reddit
I am trying to run this code https://pastebin.com/WPDDqGEk but I keep getting this error : ImportError: cannot import name 'Logger' from ...
Read more >
Python Examples of loguru.logger.warning - ProgramCreek.com
This page shows Python examples of loguru.logger.warning. ... try: import bohrium except ImportError: logger.warning('Could not import Bohrium (Bohrium ...
Read more >
Undefined symbol error during importing dolfinx - installation
But when I want to import dolfinx, it is giving this error; ... ImportError: cannot import name 'cpp' from partially initialized module ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found