evennia / evennia

Python MUD/MUX/MUSH/MU* development system

Home Page:http://www.evennia.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'

Memerlin opened this issue · comments

Describe the bug

I was following the instructions over the installation page and everything was going all fine and dandy until I had to do evennia start. Which then gives me a ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'. I was looking up pydantic and apparently some people are having problems with it as well, but I'm very new to programming so I'm not exactly sure what the problem is.

To Reproduce

Steps to reproduce the behavior:

  1. Follow the installation instructions.
  2. See error

Expected behavior

Ideally I'd be able to play "the game" and create the super user, and I'd be able to follow the instructions.

Environment, Evennia version, OS etc

    Evennia 3.2.0
    OS: nt
    Python: 3.11.8
    Twisted: 23.10.0
    Django: 4.2.10

Additional context

I tried to ask in Discord first, and to look up the problem on my own. When I try to install pydantic I get the following:

Requirement already satisfied: pydantic in c:\users\lucy\miniconda3\envs\lumimud\lib\site-packages (2.6.3)
Requirement already satisfied: annotated-types>=0.4.0 in c:\users\lucy\miniconda3\envs\lumimud\lib\site-packages (from pydantic) (0.6.0)
Requirement already satisfied: pydantic-core==2.16.3 in c:\users\lucy\miniconda3\envs\lumimud\lib\site-packages (from pydantic) (2.16.3)
Requirement already satisfied: typing-extensions>=4.6.1 in c:\users\lucy\miniconda3\envs\lumimud\lib\site-packages (from pydantic) (4.10.0)

I tried to install it like this. (Using conda install pydantic -c conda-forge) which now gives the following error:

Traceback (most recent call last):
  File "C:\Users\Lucy\miniconda3\envs\LumiMUD\evennia_launcher.py", line 7, in <module>
    main()
  File "C:\Users\Lucy\miniconda3\envs\LumiMUD\Lib\site-packages\evennia\server\evennia_launcher.py", line 2337, in main
    init_game_directory(CURRENT_DIR, check_db=True)
  File "C:\Users\Lucy\miniconda3\envs\LumiMUD\Lib\site-packages\evennia\server\evennia_launcher.py", line 1825, in init_game_directory
    check_database()
  File "C:\Users\Lucy\miniconda3\envs\LumiMUD\Lib\site-packages\evennia\server\evennia_launcher.py", line 1526, in check_database
    evennia._init()
  File "C:\Users\Lucy\miniconda3\envs\LumiMUD\Lib\site-packages\evennia\__init__.py", line 201, in _init
    from .objects.objects import (
  File "C:\Users\Lucy\miniconda3\envs\LumiMUD\Lib\site-packages\evennia\objects\objects.py", line 15, in <module>
    import inflect
  File "C:\Users\Lucy\miniconda3\envs\LumiMUD\Lib\site-packages\inflect\__init__.py", line 75, in <module>
    from pydantic import Field
ImportError: cannot import name 'Field' from 'pydantic' (C:\Users\Lucy\miniconda3\envs\LumiMUD\Lib\site-packages\pydantic\__init__.py)

Update: It works if you manually downgrade to pydantic 2.6.1 with pip install pydantic==2.6.1.
I'm not sure if I should close the issue since I fixed it but for now I'll let it be, just in case someone has my same problem.

As far as I can tell, the issue is pendantic <2.0. I have locked the requirement for this package now.