Issues with pip

I am having issues installing stuff with pip
Solution:
Claude says: It looks like you're encountering a Python installation error. The issue stems from trying to install a package that contains syntax that's incompatible with your Python 3.12 installation. The specific error is in the logging package that's being installed. It's using old Python 2.x style exception syntax (raise NotImplementedError, 'emit must be implemented') which is invalid in Python 3. In Python 3, the correct syntax would be raise NotImplementedError('emit must be implemented')....
Jump to solution
5 Replies
EdwardD
EdwardDOP7d ago
2025-02-24T22:35:42.985Z File "/usr/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 16, in <module>

2025-02-24T22:35:42.985Z from .cmd import Command

2025-02-24T22:35:42.985Z File "/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 9, in <module>

2025-02-24T22:35:42.985Z import logging

2025-02-24T22:35:42.985Z File "/tmp/pip-install-vhohy966/logging_4fa3a660d5ab485bbc25cea32f87f07b/logging/__init__.py", line 618

2025-02-24T22:35:42.985Z raise NotImplementedError, 'emit must be implemented '\

2025-02-24T22:35:42.985Z ^

2025-02-24T22:35:42.985Z SyntaxError: invalid syntax

2025-02-24T22:35:42.985Z [end of output]

2025-02-24T22:35:42.985Z

2025-02-24T22:35:42.985Z note: This error originates from a subprocess, and is likely not a problem with pip.

2025-02-24T22:35:43.086Z

2025-02-24T22:35:43.086Z [notice] A new release of pip is available: 25.0 -> 25.0.1

2025-02-24T22:35:43.086Z [notice] To update, run: pip install --upgrade pip

2025-02-24T22:35:43.088Z error: metadata-generation-failed

2025-02-24T22:35:43.088Z

2025-02-24T22:35:43.088Z × Encountered error while generating package metadata.

2025-02-24T22:35:43.088Z ╰─> See above for output.

2025-02-24T22:35:43.088Z

2025-02-24T22:35:43.088Z note: This is an issue with the package mentioned above, not pip.
2025-02-24T22:35:42.985Z File "/usr/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 16, in <module>

2025-02-24T22:35:42.985Z from .cmd import Command

2025-02-24T22:35:42.985Z File "/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 9, in <module>

2025-02-24T22:35:42.985Z import logging

2025-02-24T22:35:42.985Z File "/tmp/pip-install-vhohy966/logging_4fa3a660d5ab485bbc25cea32f87f07b/logging/__init__.py", line 618

2025-02-24T22:35:42.985Z raise NotImplementedError, 'emit must be implemented '\

2025-02-24T22:35:42.985Z ^

2025-02-24T22:35:42.985Z SyntaxError: invalid syntax

2025-02-24T22:35:42.985Z [end of output]

2025-02-24T22:35:42.985Z

2025-02-24T22:35:42.985Z note: This error originates from a subprocess, and is likely not a problem with pip.

2025-02-24T22:35:43.086Z

2025-02-24T22:35:43.086Z [notice] A new release of pip is available: 25.0 -> 25.0.1

2025-02-24T22:35:43.086Z [notice] To update, run: pip install --upgrade pip

2025-02-24T22:35:43.088Z error: metadata-generation-failed

2025-02-24T22:35:43.088Z

2025-02-24T22:35:43.088Z × Encountered error while generating package metadata.

2025-02-24T22:35:43.088Z ╰─> See above for output.

2025-02-24T22:35:43.088Z

2025-02-24T22:35:43.088Z note: This is an issue with the package mentioned above, not pip.
Some of the issues pipeline runtime log: hdXxzMUJSM60AsObwJAb4g
EdwardD
EdwardDOP7d ago
No description
EdwardD
EdwardDOP7d ago
some other concerning logs in the process
2025-02-24T22:35:42.908Z Preparing metadata (setup.py): started

2025-02-24T22:35:42.980Z Preparing metadata (setup.py): finished with status 'error'

2025-02-24T22:35:42.985Z error: subprocess-exited-with-error
2025-02-24T22:35:42.908Z Preparing metadata (setup.py): started

2025-02-24T22:35:42.980Z Preparing metadata (setup.py): finished with status 'error'

2025-02-24T22:35:42.985Z error: subprocess-exited-with-error
2025-02-24T22:35:42.985Z × python setup.py egg_info did not run successfully.

2025-02-24T22:35:42.985Z │ exit code: 1

2025-02-24T22:35:42.985Z ╰─> [24 lines of output]
2025-02-24T22:35:42.985Z × python setup.py egg_info did not run successfully.

2025-02-24T22:35:42.985Z │ exit code: 1

2025-02-24T22:35:42.985Z ╰─> [24 lines of output]
Solution
Aleš
Aleš7d ago
Claude says: It looks like you're encountering a Python installation error. The issue stems from trying to install a package that contains syntax that's incompatible with your Python 3.12 installation. The specific error is in the logging package that's being installed. It's using old Python 2.x style exception syntax (raise NotImplementedError, 'emit must be implemented') which is invalid in Python 3. In Python 3, the correct syntax would be raise NotImplementedError('emit must be implemented'). Here's what's happening: 1. You're trying to install a package using pip 2. During installation, there's a syntax error in a file called logging/__init__.py 3. This appears to be a custom logging package (not the standard library one) that's likely written for Python 2
EdwardD
EdwardDOP7d ago
Forgot to say, that was the cause, thank you very much

Did you find this page helpful?