Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run inference.py properly. #10

Open
hsnu145522 opened this issue Dec 9, 2024 · 0 comments
Open

Can't run inference.py properly. #10

hsnu145522 opened this issue Dec 9, 2024 · 0 comments

Comments

@hsnu145522
Copy link

Thank you for your excellent work.
I'm trying to run inference.py but can't run it properly.
I'm not sure if it's probably caused by package version conflict?

I'm using Python 3.9.20 and the error is:
File ".../miniconda3/envs/EpiDiff/lib/python3.9/site-packages/fastapi/init.py", line 5, in
from .applications import FastAPI
File ".../miniconda3/envs/EpiDiff/lib/python3.9/site-packages/fastapi/applications.py", line 3, in
from fastapi import routing
File ".../miniconda3/envs/EpiDiff/lib/python3.9/site-packages/fastapi/routing.py", line 6, in
from fastapi import params
File ".../miniconda3/envs/EpiDiff/lib/python3.9/site-packages/fastapi/params.py", line 4, in
from pydantic import Schema
ImportError: cannot import name 'Schema' from 'pydantic'

If I downgrade pydantic to 1.7.4 by: pip install 'pydantic<1.8.0'
The errors turns to:
File ".../miniconda3/envs/EpiDiff/lib/python3.9/site-packages/fastapi/init.py", line 5, in
from .applications import FastAPI
File ".../miniconda3/envs/EpiDiff/lib/python3.9/site-packages/fastapi/applications.py", line 3, in
from fastapi import routing
File ".../miniconda3/envs/EpiDiff/lib/python3.9/site-packages/fastapi/routing.py", line 6, in
from fastapi import params
File ".../miniconda3/envs/EpiDiff/lib/python3.9/site-packages/fastapi/params.py", line 14, in
class Param(Schema):
TypeError: cannot create 'cython_function_or_method' instances

I have the problem of the version of fastapi and pydantic.
Can anyone help please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant