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

Error on startup with pre release 1.1.7 #472

Closed
sthiele opened this issue May 10, 2023 · 9 comments · Fixed by #474
Closed

Error on startup with pre release 1.1.7 #472

sthiele opened this issue May 10, 2023 · 9 comments · Fixed by #474
Labels
bug Something isn't working

Comments

@sthiele
Copy link
Member

sthiele commented May 10, 2023

Following the install instruction I get the following error.

❯  conda activate cnapy-1.1.7
❯ cnapy
Traceback (most recent call last):
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/bin/cnapy", line 6, in <module>
    from cnapy.__main__ import main_cnapy
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/cnapy/__main__.py", line 31, in <module>
    from cnapy.application import Application
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/cnapy/application.py", line 42, in <module>
    from cnapy.gui_elements.main_window import MainWindow
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/cnapy/gui_elements/main_window.py", line 10, in <module>
    from cnapy.core import model_optimization_with_exceptions
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/cnapy/core.py", line 15, in <module>
    import efmtool_link.efmtool4cobra as efmtool4cobra
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/efmtool_link/efmtool4cobra.py", line 1, in <module>
    import efmtool_link.efmtool_intern as efmtool_intern
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/efmtool_link/efmtool_intern.py", line 9, in <module>
    jpype.startJVM()
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/jpype/_core.py", line 184, in startJVM
    jvmpath = getDefaultJVMPath()
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/jpype/_jvmfinder.py", line 74, in getDefaultJVMPath
    return finder.get_jvm_path()
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7/lib/python3.8/site-packages/jpype/_jvmfinder.py", line 212, in get_jvm_path
    raise JVMNotFoundException("No JVM shared library file ({0}) "
jpype._jvmfinder.JVMNotFoundException: No JVM shared library file (libjvm.so) found. Try setting up the JAVA_HOME environment variable properly.
@sthiele sthiele added the bug Something isn't working label May 10, 2023
@sthiele
Copy link
Member Author

sthiele commented May 10, 2023

Maybe it has something to do with openjdk which is now on version openjdk=8.0.332=h166bdaf_0 for me?

@axelvonkamp
Copy link
Member

What is the jpype1 version of your environment?

@sthiele
Copy link
Member Author

sthiele commented May 10, 2023

What is the jpype1 version of your environment?

  • jpype1=1.4.1=py38h43d8883_1

@axelvonkamp
Copy link
Member

Can you try an older version of jpype1? I still have got 1.2.1. Strangely though, the PR checks did not show this issue.

@sthiele
Copy link
Member Author

sthiele commented May 10, 2023

I downgraded to jpype1=1.2.1=py38h1fd1430_0 and have the same issue.

Strangely though, the PR checks did not show this issue.

Might be because I'm not on an ubuntu machine.

@sthiele
Copy link
Member Author

sthiele commented May 10, 2023

It is probably because i use fish. conda issue

But with zsh I get another error:

openjdk version "1.8.0_332"
OpenJDK Runtime Environment (Zulu 8.62.0.19-CA-linux64) (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (Zulu 8.62.0.19-CA-linux64) (build 25.332-b09, mixed mode)
Restricted license - for non-production use only - expires 2024-10-28
Could not find font_size in cnapy-config.txt
Traceback (most recent call last):
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7p/bin/cnapy", line 10, in <module>
    sys.exit(main_cnapy())
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7p/lib/python3.8/site-packages/cnapy/__main__.py", line 34, in main_cnapy
    Application()
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7p/lib/python3.8/site-packages/cnapy/application.py", line 76, in __init__
    self.window = MainWindow(self.appdata)
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7p/lib/python3.8/site-packages/cnapy/gui_elements/main_window.py", line 68, in __init__
    self.central_widget = CentralWidget(self)
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7p/lib/python3.8/site-packages/cnapy/gui_elements/central_widget.py", line 72, in __init__
    self.reaction_list = ReactionList(self)
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7p/lib/python3.8/site-packages/cnapy/gui_elements/reactions_list.py", line 131, in __init__
    self.reaction_mask = ReactionMask(self)
  File "/home/sthiele/miniconda3/envs/cnapy-1.1.7p/lib/python3.8/site-packages/cnapy/gui_elements/reactions_list.py", line 678, in __init__
    self.grp_test_model.add_reaction(reaction)
AttributeError: 'Model' object has no attribute 'add_reaction'

@axelvonkamp
Copy link
Member

Can you try to replace the line 678 in reactions_list.py with

self.grp_test_model.add_reactions([reaction])

add_reaction is deprecated but should actually still work.

@sthiele
Copy link
Member Author

sthiele commented May 11, 2023

That works. I did not test thoroughly but CNApy is up and running. 😄

@sthiele
Copy link
Member Author

sthiele commented May 12, 2023

Oh yeah, some other things I noted.

  • The scenario name is in an unfortunate position I think I can click on it but nothing happens.
  • Idea: Maybe replace the icon for scenario open with the name of the scenario
  • The other toolbar buttons (reload/save scenario) if they are disabled should be greyed out
  • How do I know that the scenario has been changed/unsaved? I think there should be some indication if the current scenario is not the same as the one that is on the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants