Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error while installing 'formatter' module

Tags:

python

I am trying to install formatter using,

pip install formatter

but it throws the following error,

Collecting formatter
  Using cached formatter-1.0.3.tar.gz (17 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/2b/x_hy0wt13mgcbznrm263kzmr0000gr/T/pip-install-l76arg1s/formatter_b9bbf1e04d7a4bda8f51556e744f0357/setup.py", line 2, in <module>
          import formatter as metadata
        File "/private/var/folders/2b/x_hy0wt13mgcbznrm263kzmr0000gr/T/pip-install-l76arg1s/formatter_b9bbf1e04d7a4bda8f51556e744f0357/formatter/__init__.py", line 9, in <module>
          from .formatter import Formatter
        File "/private/var/folders/2b/x_hy0wt13mgcbznrm263kzmr0000gr/T/pip-install-l76arg1s/formatter_b9bbf1e04d7a4bda8f51556e744f0357/formatter/formatter.py", line 4, in <module>
          from cStringIO import StringIO
      ModuleNotFoundError: No module named 'cStringIO'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I tried installing cStringIO but it throws another error,

ERROR: Could not find a version that satisfies the requirement cStringIO (from versions: none)
ERROR: No matching distribution found for cStringIO

Can anyone help me ?

like image 942
Ayush Kumar Avatar asked Oct 26 '25 22:10

Ayush Kumar


1 Answers

This package was removed from python 3.10 (see latest doc from 3.9). You should update the code to not use the formatter module.

like image 161
Étienne Avatar answered Oct 29 '25 14:10

Étienne