Russell-Newton / TikTokPy

Extract data from TikTok without needing any login information or API keys.
https://pypi.org/project/tiktokapipy/
MIT License
208 stars 27 forks source link

[QUESTION] #49

Closed Fabien-desablens closed 1 year ago

Fabien-desablens commented 1 year ago

C:\Users\Administrator\Documents\TikTokGrab>TikTokGrabAlphav0.2.py Traceback (most recent call last): File "C:\Users\Administrator\Documents\TikTokGrab\TikTokGrabAlphav0.2.py", line 1, in from tiktokapipy.api import TikTokAPI File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\tiktokapipy\api.py", line 32, in from tiktokapipy.models import DeferredIterator, TikTokDataModel File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\tiktokapipy\models__init__.py", line 24, in from pydantic.main import ModelMetaclass ImportError: cannot import name 'ModelMetaclass' from 'pydantic.main' (C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic\main.py)

The code was working great until I installed your 0.2 version of the api to be able to scrap more user's videos. I had an issue with it so I get back to the previous version of the api. But now I have errors with pydantic. I tried to uninstall it and the api too. But still the error occurs. Do you have any idea how to fix ?

Tks

Russell-Newton commented 1 year ago

Please list the versions of tiktokapipy and pydantic as displayed by pip freeze.

Fabien-desablens commented 1 year ago

hello,

pip freeze | findstr tiktokapipy tiktokapipy==0.1.13.post1

pip freeze | findstr pydantic pydantic==2.0.1 pydantic_core==2.0.2

I tried to uninstall and reinstall several times as I said

Russell-Newton commented 1 year ago

This issue should be resolved in the new release 0.2.0. This issue was caused by a dependency mismatch between with tiktokapipy and pydantic. Pydantic just put out its version 2 update, which breaks tiktokapipy~=0.1. This is no longer a problem in 0.2.0. Closing as resolved. If it isn't, reopen this issue or create a bug ticket.