Forums

PythonAnywhere doesn't work with a package Instagrapi?

Error

Traceback (most recent call last):
  File "/home/VivatGrunwald/bot.py", line 1, in <module>
    from instagrapi import Client
  File "/home/VivatGrunwald/.local/lib/python3.10/site-packages/instagrapi/__init__.py", line 7, in <module>
    from instagrapi.mixins.account import AccountMixin
  File "/home/VivatGrunwald/.local/lib/python3.10/site-packages/instagrapi/mixins/account.py", line 8, in <module>
    from instagrapi.extractors import extract_account, extract_user_short
  File "/home/VivatGrunwald/.local/lib/python3.10/site-packages/instagrapi/extractors.py", line 6, in <module>
    from .types import (
  File "/home/VivatGrunwald/.local/lib/python3.10/site-packages/instagrapi/types.py", line 13, in <module>
    class Resource(BaseModel):
  File "pydantic/main.py", line 197, in pydantic.main.ModelMetaclass.__new__
  File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer
  File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.__init__
  File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare
  File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis
  File "/usr/local/lib/python3.10/typing.py", line 1157, in __subclasscheck__
    return issubclass(cls, self.__origin__)
TypeError: issubclass() arg 1 must be a class

So I get this error when I run an Instagrapi related code, why tf does this happen, on my local machine my code works FINE and here it DOESN'T, what happened, man.. I can't figure this out myself, been thinking of this for hours now.. Somebody, please, help. Me.

[edit by admin: formatting]

Do you have the same package versions running locally as you do on pythonanywhere?

Yes

There must be a difference so you need to check file by file.