iSarabjitDhiman / TweeterPy

TweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc.
MIT License
123 stars 17 forks source link

Error in demjson setup command: use_2to3 is invalid #28

Closed sanammathouda closed 10 months ago

sanammathouda commented 10 months ago

Hi @iSarabjitDhiman

I got this error while installing TweeterPy.

Collecting demjson
  Downloading demjson-2.2.4.tar.gz (131 kB)
     ---------------------------------------- 131.5/131.5 kB 2.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in demjson 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: 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.
iSarabjitDhiman commented 10 months ago

hey @sanammathouda

The issue is related to the demjson library which I used in TweeterPy 1.0.1 version (the most recent one). Check here for more details.

I replaced js2py library with demjson as it was a bit slow while parsing javascript object. But this newly added demjson library has installation issues which can be solved by installing pip install setuptools==57.5.0 Umm, either I am gonna have to find some other alternate to parse javascript object (convert javascript object to python dict) or roll back to js2py package(its a bit slow).

I also checked chompjs its perfect and the fastest one out there. But it has installation issues on windows.

Anyway, here is how you can fix it :

Manually install setuptools version 57.5.0

pip install setuptools==57.5.0

Now try to install TweeterPy

pip install tweeterpy --upgrade --no-cache-dir

The issue should be resolved by installing setuptools version 57.5.0

Edit : Fixed https://github.com/iSarabjitDhiman/TweeterPy/commit/6ba8ec6022f28e756e62785606fa5ad98d2efa5f Solution here / Duplicate: #27 - replaced demjson with demjson3 as @codilau suggested.

sanammathouda commented 10 months ago

It worked, I installed setuptools 57.5.0 version and then installed TweeterPy. Thanks.