Registration module does not work with Python3

I'm having problems with the standard logging module. If I open the python2.7 shell and import the log, everything will work fine:

$ python
>>> import logging
>>>

But if I open the python3.4 shell and register the import log, I get the following error:

$ python3.4
>>> import logging
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2222, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 2164, in _find_spec
File "<frozen importlib._bootstrap>", line 1940, in find_spec
File "<frozen importlib._bootstrap>", line 1916, in _get_spec
File "<frozen importlib._bootstrap>", line 1897, in _legacy_get_spec
File "<frozen importlib._bootstrap>", line 863, in spec_from_loader
File "<frozen importlib._bootstrap>", line 904, in spec_from_file_location
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/logging-0.4.9.6-py3.4.egg/logging/__init__.py", line 618
raise NotImplementedError, 'emit must be implemented '\
                         ^
SyntaxError: invalid syntax

I don’t know what the problem is, and cannot find anyone else who had the same problem.

+4
source share
2 answers

It seems you have installed a third-party library in Python 3 with a name loggingthat hides the standard version of the library, and one of its files has a typo.

+6
source

Python 3. .

+1

Source: https://habr.com/ru/post/1605854/


All Articles