-
Notifications
You must be signed in to change notification settings - Fork 9
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
'comets.py' error #50
Comments
I think I've seen similar problem before. Can you send me the script you are trying to run? Can you run the P1_test_tube_aerobic.ipynb at all? You can get is here: https://sites.google.com/view/comets-tutorial/home |
I think I know what the bug is. "line_terminator" should be "lineterminator" in to_csv(f, mode='a', line_terminator = '\n', header=False, index=False) Let me change and test this. |
My script is below: I run 'P1_test_tube_aerobic.ipynb' but got same error. |
OK, I think, in model.py all "line_terminator" need to be changed to "lineterminator". I will try that later today, but you may try to do it yourself and test it. Then you can actually push it here. I would appreciate that. :) |
I changed and test it and solved this, after then I got another error in my script: Running COMETS simulation ...
RuntimeError Traceback (most recent call last) File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:400, in comets.run(self, delete_files) File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:568, in comets.__analyze_run_output(self) RuntimeError: COMETS simulation did not complete: Same error in your script: Running COMETS simulation ...
RuntimeError Traceback (most recent call last) File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:400, in comets.run(self, delete_files) File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:565, in comets.__analyze_run_output(self) RuntimeError: COMETS simulation did not complete:
|
This seems like you don't have gurobi installed properly. Are you doing this on Linux? If yes, make sure you have the GUROBI_COMETS_HOME defined in your .bashrc file. export COMETS_HOME=/projectnb/cometsfba/comets_2.11.1 export GUROBI_PATH=$GUROBI_HOME Make sure you adapt them to your case, wherever you installed gurobi should replace my line /share/pkg.7/gurobi/9.0.0/install/ |
No, I am using MacOS |
On Mac you need this line: |
I tried this line in .bashrc file: but, I got this error again: Running COMETS simulation ...
RuntimeError Traceback (most recent call last) File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:400, in comets.run(self, delete_files) File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:565, in comets.__analyze_run_output(self) RuntimeError: COMETS simulation did not complete:
|
Hi all, this is an aside, but while the lineterminator thing probably
should be changed, it shouldn't cause an error I don't think. It is more
likely a red herring related to other issues.
…On Mon, Feb 26, 2024 at 3:39 AM 2132030 ***@***.***> wrote:
I tried this line in .bashrc file:
export GUROBI_HOME= /Library/gurobi1100/macos_universal2
but, I got this error again:
Running COMETS simulation ...
Error: COMETS simulation did not complete
examine comets.run_output for the full java trace
if we detect a common reason, it will be stated in the RuntimeError at the bottom
------------------------------
RuntimeError Traceback (most recent call last)
Cell In[19], line 1
----> 1 experiment.run()
File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:400, in
comets.run(self, delete_files)
397 self.run_errors = "STDERR empty."
399 # Raise RuntimeError if simulation had nonzero exit
--> 400 self.__analyze_run_output()
402 # '''----------- READ OUTPUT ---------------------------------------'''
403 # Read total biomass output
404 if self.parameters.all_params['writeTotalBiomassLog']:
File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:565, in
comets.__analyze_run_output(self)
563 message += "if in Unix. In Windows, it suggests that something
changed\n"
564 message += "with the dependencies installed alongside COMETS"
--> 565 raise RuntimeError(f"COMETS simulation did not complete:\n
{message}")
567 message = "undetected reason. examine comets.run_output for JAVA trace"
568 raise RuntimeError(f"COMETS simulation did not complete:\n {message}")
RuntimeError: COMETS simulation did not complete:
JAVA could not find gurobi.
try the following:
import os
os.environ['GUROBI_COMETS_HOME']
if there is nothing there try setting that variable
to the location of gurobi.jar, for example:
os.environ['GUROBI_COMETS_HOME'] = '/opt/gurobi900/linux64'
—
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLGCRNDA2J76J6CFZAOH5DYVRJ35AVCNFSM6AAAAABDWOQ5WOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRTGY4DSNBXHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
*Jeremy M. Chacón, Ph.D.*
*he / him / his*
*Bioinformatics Analyst*
*RI Bioinformatics*
*Minnesota Supercomputing Institute*
*University of Minnesota*
|
You need to make sure that you are running bash on your Mac. If you are running zsh, which is the default in latest Macs, you need to get that line in the .zshrc file. Check, do you have a .zshrc file? |
Yes, I have .zshrc file |
I tried in the .zshrc file but I got this error again :( RuntimeError: COMETS simulation did not complete:
|
Can you show me a screenshot of your gurobi path and directory contents? |
aha, yes. The problem is that /lib at the end. |
Good morning. Are you positive that gurobi is installed properly? Gurobi has a test case in their install instructions which is worth double-checking. If it is installed properly, would you post a screenshot of your gurobi's path all the way to gurobi.jar? Thanks! |
To follow up on Jeremy's comment, |
I get this error after 'sim.run()' code;
Running COMETS simulation ...
TypeError Traceback (most recent call last)
Cell In[73], line 1
----> 1 sim.run()
File ~/anaconda3/lib/python3.11/site-packages/cometspy/comets.py:362, in comets.run(self, delete_files)
359 c_package = self.working_dir + '.current_package' + to_append
360 c_script = self.working_dir + '.current_script' + to_append
--> 362 self.layout.write_necessary_files(self.working_dir, to_append)
364 # self.layout.write_layout(self.working_dir + '.current_layout')
365 self.parameters.write_params(c_global, c_package)
File ~/anaconda3/lib/python3.11/site-packages/cometspy/layout.py:636, in layout.write_necessary_files(self, working_dir, to_append)
634 self.__check_if_initial_pops_in_range()
635 self.write_layout(working_dir, to_append)
--> 636 self.write_model_files(working_dir)
File ~/anaconda3/lib/python3.11/site-packages/cometspy/layout.py:641, in layout.write_model_files(self, working_dir)
639 '''writes each model file'''
640 for m in self.models:
--> 641 m.write_comets_model(working_dir)
File ~/anaconda3/lib/python3.11/site-packages/cometspy/model.py:973, in model.write_comets_model(self, working_dir)
969 with open(path_to_write, 'a') as f:
971 f.write('SMATRIX ' + str(len(self.metabolites)) +
972 ' ' + str(len(self.reactions)) + '\n')
--> 973 smat.to_csv(f, mode='a', line_terminator = '\n', header=False, index=False)
974 f.write(r'//' + '\n')
976 f.write('BOUNDS ' +
977 str(self.default_bounds[0]) + ' ' +
978 str(self.default_bounds[1]) + '\n')
TypeError: NDFrame.to_csv() got an unexpected keyword argument 'line_terminator'
How can fix it? Can you help me?
The text was updated successfully, but these errors were encountered: