Comments (6)
Seems reasonable to me. Feel free to send a PR with a newer requirement. That way we will see if the CI passes.
from cobrapy.
Maybe just >=1.6 would allow both users of <2 and >2 to happily use cobrapy.
from cobrapy.
The PR above just changes the ~
here to a >
as @Midnighter suggests.
I think the CI is just waiting for a maintainer to approve before it sets off.
from cobrapy.
Now fixed in 0.27.0.
from cobrapy.
Problem description
From a quick look I don't think cobrapy uses pydantic except for in this file, which I think is compatible with pydantic version 2 as is. It therefore doesn't seem like a very hard bug to fix: just remove the pin or change it to a version greater than 2.
@teddygroves or @cdiener, did you test whether the file referenced is compatible with pydantic v2? I ask because when setting up a new environment with conda, I get the following import error when importing cobra (cobra=0.29.0, pydantic=2.5.6):
Traceback (most recent call last):
File "", line 1, in
File "/home/a/.conda/envs/cobra/lib/python3.12/site-packages/cobra/init.py", line 17, in
from cobra import io
File "/home/a/.conda/envs/cobra/lib/python3.12/site-packages/cobra/io/init.py", line 9, in
from cobra.io.web import AbstractModelRepository, BiGGModels, BioModels, load_model
File "/home/a/.conda/envs/cobra/lib/python3.12/site-packages/cobra/io/web/init.py", line 6, in
from .biomodels_repository import BioModels
File "/home/a/.conda/envs/cobra/lib/python3.12/site-packages/cobra/io/web/biomodels_repository.py", line 14, in
class BioModelsFile(pydantic.BaseModel):
^^^^^^^^^^^^^^^^^^
File "/home/a/.conda/envs/cobra/lib/python3.12/site-packages/pydantic/init.py", line 372, in getattr
module = import_module(module_name, package=package)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/a/.conda/envs/cobra/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/a/.conda/envs/cobra/lib/python3.12/site-packages/pydantic/main.py", line 13, in
from pydantic_core import PydanticUndefined
ImportError: cannot import name 'PydanticUndefined' from 'pydantic_core' (unknown location)
I forced conda to install pydantic-1.10.0 and import cobra
works fine. I do not have experience with pydantic, so I'm not clear if this is an issue with the requirements or not, but it appears that something does break when upgrading to pydantic v2.
from cobrapy.
Hi this error seems to be raised in pydantic itself and there seems to have been a bug in the conda package. Can you update your pedantic in the environment to a newer build and try again?
from cobrapy.
Related Issues (20)
- problems reading certain AGORA2 models HOT 3
- Can Not Open the SBML File HOT 4
- Give parameters to model.optimize()
- How to set the model solver HOT 1
- ContainerAlreadyContains error with the fastcc() HOT 3
- createMultipleSpeciesModel function can not find in cobrapy HOT 4
- SBML file not getting uploaded HOT 2
- How to perform relaxedFBA with cobrapy? HOT 1
- Cannot import cobra: import error involving numpy HOT 4
- how to handle mixed-integer programming (MIP) problems with the glpk, cplex or/and gurobi solvers in python/with cobrapy? HOT 3
- Model valid but cannot be loaded HOT 2
- Flux-Samplig: Cannot escape sampling region, model seems to be numerically unstable. Reporting the model HOT 1
- gurobipy.Model.addConstr() DeprecationWarning HOT 4
- find_gene_knockout_reactions error HOT 1
- AttributeError: 'list' object has no attribute 'items' HOT 7
- Hello I am new to python and Cobra, i would be grateful if you can provide me with steps to open an XML file from the computer and/or from online database, i tried the commands on Cobra documentation but i can't apply it.
- upgrading dependency to allow pandas>=2.0 HOT 1
- [BUG] Biomodels web io access broekn due to redirects
- Adding new metabolites HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cobrapy.