33

I'm trying to install the logging module for Python 3.4. I'm using pip3 install logging. Both times I run into a SyntaxError at line 618 of the __init__ method: "raise NotImplementedError, 'emit must be implemented '\".

Someone posted the same question as me, and solved their problem by deleting an interfering third party library called logging: Logging module not working with Python3.

But I have no such library already installed in my site-packages directory.

1
  • "I'm trying to install the logging module for Python 3.4. I'm using pip3 install logging... But I have no such library already installed in my site-packages directory." - ??? Just to make sure: you understood that the purpose of pip3 install is to put things in the site-packages directory? And that you could not possibly get a SyntaxError from this code if it weren't installed, since installing it is what makes it available to run? Therefore, you did, in fact, have it installed. Commented May 3, 2024 at 23:36

2 Answers 2

76

logging is part of the Python standard library, and has been since version 2.3. It's available as soon as you install Python. You don't need to pip install anything...

Sign up to request clarification or add additional context in comments.

2 Comments

none of the standard libraries get installed when using virtualenv for python3. So how would one install logging into a virtualenv?
@wesm of course they do. Python wouldn't function without the stdlib. The files may not be copied into your virtualenv from the system location, but they're still available for use.
2

You don't need to install the logging module separately.

logging is a standard Python module, and it comes with the Python installation.

You just need to use import logging in your python code.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.