kotartemiy / pygooglenews

If Google News had a Python library
https://newscatcherapi.com
MIT License
1.3k stars 140 forks source link

error in feedparser setup command: use_2to3 is invalid. #40

Open omar-yehia opened 1 year ago

omar-yehia commented 1 year ago

I tried to install it pip install pygooglenews

but I got this error

. . Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [1 lines of output] error in feedparser setup command: use_2to3 is invalid. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

markus-lei commented 1 year ago

Hello,

I have the same issue on Mac OS. Tried downgrading setuptools but did not work :(

Kamilcuk commented 1 year ago

https://bobbyhadz.com/blog/python-error-in-package-setup-command-use-2to3-is-invalid

ghost commented 1 year ago

The error message due to a breaking change in setuptools version 58.0.0. The setuptools package has removed support for 2to3 during builds. You can try downgrading setup tools by running this command: pip install "setuptools<58.0". After that, you can try running your pip install command again. I hope this helps!

benputman commented 1 year ago

this worked for me. (On Mac OS 13.4.1, Python 3.10.12)

pip install "setuptools<58.0"
pip install feedparser --upgrade
pip install setuptools

first line got it installed and the second resolved the outdated feedparser issue. Last line returns setuptools to normal

linconz commented 1 week ago
PS C:\Users\Admin> pip install setuptools==57.5.0
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting setuptools==57.5.0
  Using cached https://mirrors.aliyun.com/pypi/packages/4b/b9/71687c5d2034c863db1db2e0704f5e27581ff3cb44d7f293968c5e08ceb3/setuptools-57.5.0-py3-none-any.whl (819 kB)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 58.0.0
    Uninstalling setuptools-58.0.0:
      Successfully uninstalled setuptools-58.0.0
Successfully installed setuptools-57.5.0

[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
PS C:\Users\Admin> pip install pygooglenews --upgrade
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting pygooglenews
  Using cached https://mirrors.aliyun.com/pypi/packages/59/cb/84f162888a07e501630f6be7c70997c5c8afd5ba4a40c3a079c321e97c29/pygooglenews-0.1.2-py3-none-any.whl (10 kB)
Collecting beautifulsoup4<5.0.0,>=4.9.1 (from pygooglenews)
  Using cached https://mirrors.aliyun.com/pypi/packages/b1/fe/e8c672695b37eecc5cbf43e1d0638d88d66ba3a44c4d321c796f4e59167f/beautifulsoup4-4.12.3-py3-none-any.whl (147 kB)
Collecting dateparser<0.8.0,>=0.7.6 (from pygooglenews)
  Using cached https://mirrors.aliyun.com/pypi/packages/c1/d5/5a2e51bc0058f66b54669735f739d27afc3eb453ab00520623c7ab168e22/dateparser-0.7.6-py2.py3-none-any.whl (362 kB)
Collecting feedparser<6.0.0,>=5.2.1 (from pygooglenews)
  Using cached https://mirrors.aliyun.com/pypi/packages/5d/20/c6ec54fc79fb944f2058a5fef149b8a0d67993db5e3ba7ea58ce931e365e/feedparser-5.2.1.zip (1.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in feedparser setup command: use_2to3 is invalid.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Windows10, Power Shell

I'm already pip install setuptools==57.5.0 still not work, why?