添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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 ?

It looks like you are trying to install a package which is meant for python 2.x in python 3.x. cStringIO has been renamed to io in python 3. But i would suggest you to look for another package, as the formatter package has been last updated 8 years ago, is for python 2.x and can be considered abandoned (the github repo doesn't even exist anymore). – Mime Jun 22, 2022 at 10:00 This package seems to be deprecated. Can you try installing formatter2: pip install formatter2 – Rafael-WO Jun 22, 2022 at 10:01

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.