I am new to working with cobrapy and was hoping to gain some insight. I have generated a metabolic model in Kbase. There are options to download the model in SBML or JSON format, which should both work in cobra. However, I get an error code that states the object has no reactions attribute when trying to import a .json file (Note: this is from an output in pycharm):
C:\Users\Rachel\PycharmProjects\cobrapytest\venv\Scripts\python.exe C:/Users/Rachel/PycharmProjects/cobrapytest/Gen_test.py
Traceback (most recent call last):
File "C:/Users/Rachel/PycharmProjects/cobrapytest/Gen_test.py", line 13, in <module>
cobra.io.load_json_model(data_dir)
File "C:\Users\Rachel\PycharmProjects\cobrapytest\venv\lib\site-packages\cobra\io\json.py", line 136, in load_json_model
return model_from_dict(json.load(file_handle))
File "C:\Users\Rachel\PycharmProjects\cobrapytest\venv\lib\site-packages\cobra\io\dict.py", line 211, in model_from_dict
raise ValueError('Object has no reactions attribute. Cannot load.')
ValueError: Object has no reactions attribute. Cannot load.
Process finished with exit code 1
C:\Users\Rachel\PycharmProjects\cobrapytest\venv\Scripts\python.exe C:/Users/Rachel/PycharmProjects/cobrapytest/Gen_test.py
'' is not a valid SBML 'SId'.
Process finished with exit code 0