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

Syntax Error in server.py Causes BERN2 Local Installation to Not Work #34

Closed
compbiolover opened this issue Aug 19, 2022 · 5 comments
Closed

Comments

@compbiolover
Copy link

Hi @minstar & @mjeensung ,
I have attempted to install BERN2 locally, but I get the following error when I launch it:

Traceback (most recent call last):
  File "server.py", line 1, in <module>
    from app import create_app
  File "/Users/[myuser]/BERN2/app/__init__.py", line 129
    return render_template('result_text.html', result_items=res_items, latency = f'{latency*1000:9.2f}', result_str=json.dumps(result_dict, sort_keys=True, indent=4))

I have also seen that this error appears to keep server.py from running as it is not running when I run bash stop_bern2.sh.
I get the following output

No ner_server.py found to stop.
Stopped GNormPlusServer.main.jar
Stopped tmVar2Server.main.jar
Stopped disease_normalizer_21.jar
Stopped gnormplus-normalization_21.jar
No server.py found to stop.

Finally, I still tried to submit the plain text and PMID examples listed under the local instillation instructions and I simply get no output even after waiting for several minutes. My thought process leads me to believe that the error in server.py is causing BERN2 to simply terminate and hence no outputs from the tutorial text and PMIDS.

Thanks for your help! Let me know if I can help with any additional files or insight.

Andrew

@mjeensung
Copy link
Contributor

Hi @compbiolover

Yes, it doesn't seem that ner_server.py started correctly.
Could you check the log of ner_server.py?
It is written on logs/nohup_multi_ner.out.

@compbiolover
Copy link
Author

Sure @mjeensung,
logs/nohup_multi_ner.out has the following error message:

    f'{dict_path[2:]}.PubTator')
                              ^
SyntaxError: invalid syntax
  File "multi_ner/ner_server.py", line 23
    f'{dict_path[2:]}.PubTator')
                              ^
SyntaxError: invalid syntax

@mjeensung
Copy link
Contributor

Thanks @compbiolover

What's the Python version you are using?
BERN2 runs well on Python 3.7 and it may cause unexpected problems on different versions of Python.

@compbiolover
Copy link
Author

No problem @mjeensung,
I am using Python 3.7.13 when I do condo list inside my BERN2 miniconda environment. I can try re-installing BERN2 with Python 3.7 and see if that fixes the issue

@mjeensung
Copy link
Contributor

If you still have a problem, please feel free to open a new issue. Thank you.

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