JKoblitz / metano

Metano is an open-source metabolic modeling toolbox
GNU General Public License v3.0
1 stars 1 forks source link

Error: cannot import name 'clock' from 'time' (unknown location) #1

Open martsper opened 2 years ago

martsper commented 2 years ago

Dear Metano developers,

I have trouble to get Metano running, maybe you have an idea for how to fix it.

I installed metano in a conda base environment (python 3.8.12; conda 4.11.0).

When running fba.py, or any other script, I get the following: ImportError: cannot import name 'clock' from 'time' (unknown location)

(specifically, I would like to run sbmlwriter.py, which is currently not implemented in the metano webpage).

Best,

Martin

martsper commented 2 years ago

Hi again,

we made several attempts to install metano under different python versions. Our aim was to convert your metabolic model of Phaeobacter into a SBML file. The closest we came to get it running was with using a conda environment, and the following definitions:

name:

channels:

dependencies:

Then, we run the following command:

sbmlwriter.py -r rea_iPin571.txt -p sce_iPin571_WT-Alanine.txt -o output.txt

Input files (downloaded from here: https://mmtb.brenda-enzymes.org/models/view/12) rea_iPin571.txt sce_iPin571_WT-Alanine.txt

However, the result is as follows:

Start creating SBML file 'output.txt'.. Reaction file: 'rea_iPin571.txt' Scenario file: 'sce_iPin571_WT-Alanine.txt' Compartment reg-ex: 'None' Default compartment: 'Cytosol' Infinity value: None Info: The metabolic network has 692 reactions and 564 metabolites. Traceback (most recent call last): File "/users/pmamirs/anaconda3/envs/metano/bin/sbmlwriter.py", line 8, in sys.exit(main()) File "/users/pmamirs/anaconda3/envs/metano/lib/python3.7/site-packages/metano/sbmlwriter.py", line 750, in main sbmlWriter.writeFile(options.outputFile) File "/users/pmamirs/anaconda3/envs/metano/lib/python3.7/site-packages/metano/sbmlwriter.py", line 346, in writeFile sbml.setAttribute(SbmlDef.LEVEL, "3") File "/users/pmamirs/anaconda3/envs/metano/lib/python3.7/xml/dom/minidom.py", line 741, in setAttribute attr.ownerDocument = self.ownerDocument AttributeError: ownerDocument

We are not sure at this point if this is a version issue or an issue with the input format. The module xml.dom.minidom is built into python and we are not sure if there is a way to check different versions without changing the python version, which we have already done. We would appreciate any help on how to get the sbmlwriter.py script up and running.

Best, Martin

[UPDATE]

We also tried the above command line (sbmlwriter.py -r rea_iPin571.txt -p sce_iPin571_WT-Alanine.txt -o output.txt) inside the metano docker container. It produced the same error as pasted above (using the input files I linked). We also tried sbmlwriter.py with the provided example data, but got the same error. However, when we ran the Phaeobacter model with the fba.py script inside the docker container, everything works fine.

So, it looks like that there is a problem with the sbmlwriter.py script, or a dependency issue. Again, we would really appreciate any help with our problem of converting the Phaeobacter model into a format that can be used outside the metano toolbox.

JKoblitz commented 2 years ago

Dear @martsper,

sorry for the late response. GitHub didn't think it was necessary to notify me. However, I found the source of your problem. Apparently minidom has changed something about their syntax. I have adjusted the sbmlwriter.py and released a new version: https://pypi.org/project/metano/1.3.1/ Updating should resolve your issue. I will leave this issue open for now, so come back to me if something happens again.

Cheers, Julia

martsper commented 2 years ago

Dear Julia,

that's great, thanks a lot for fixing it! I am looking forward to work on the model, and to further explore the metano toolbox.

Best, Martin