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

Non-linear solver not compatible with python versions >= 3.8 #1

Open
azournas opened this issue Dec 25, 2023 · 1 comment
Open

Non-linear solver not compatible with python versions >= 3.8 #1

azournas opened this issue Dec 25, 2023 · 1 comment

Comments

@azournas
Copy link

I am getting an error when running the file tutorial_synechocystis_inst_simulation.py, attached in this message. The jist of the problem is that openopt calls time.clock(), which is deprecated in python 3.3 and removed in python 3.8. As python 3.7 is not available in apple silicon, I can't think of an easy workaround.

For simulation purposes, since the fitter is not used, commenting out lines 23 and 24 from model.py, where the imports are happening, solves the problem, but it's not possible to run the estimation.

Is there a way to solve this issue with the existing code?

Thank you!

( freeflux % /Users/user/anaconda3/envs/freeflux/bin/python /Users/user/freeflux/tutorials/tutorial_synechocystis_inst_simulation.py
Traceback (most recent call last):
File "/Users/user/freeflux/tutorials/tutorial_synechocystis_inst_simulation.py", line 7, in
from freeflux import Model
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/freeflux/init.py", line 7, in
from .core.model import Model
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/freeflux/core/model.py", line 23, in
from ..analysis.fit import Fitter
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/freeflux/analysis/fit.py", line 20, in
from ..solver.nlpsolver import MFAModel
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/freeflux/solver/nlpsolver.py", line 13, in
from openopt import NLP
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/openopt/init.py", line 10, in
from oo import *
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/openopt/oo.py", line 4, in
from LP import LP as CLP
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/openopt/kernel/LP.py", line 1, in
from baseProblem import MatrixProblem
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/openopt/kernel/baseProblem.py", line 10, in
from ooIter import ooIter
File "/Users/user/anaconda3/envs/freeflux/lib/python3.9/site-packages/openopt/kernel/ooIter.py", line 3, in
from time import time, clock
ImportError: cannot import name 'clock' from 'time' (unknown location)

@Chaowu88
Copy link
Owner

Hi azournas, please refer to https://freeflux.readthedocs.io/en/latest/installation.html#dependencies-and-compatibility. You can use the corrected files to replace those in the openopt installation path.

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

2 participants