Forums

Receiving a docstring error on the server, but not when running on local machines.

Hello, I have been getting a rather frustrating error on my web server resulting in an internal server error. We were receiving the error detailed below:

  • Serving Flask app "main" (lazy loading)
  • Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Debug mode: on
  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  • Restarting with stat Traceback (most recent call last): File "/home/hemopheno/mysite/HemoPheno4HFMain.py", line 50, in <module> app.run(debug=True) File "/usr/lib/python3.8/site-packages/flask/app.py", line 990, in run run_simple(host, port, self, **options) File "/usr/lib/python3.8/site-packages/werkzeug/serving.py", line 1008, in run_simple run_with_reloader(inner, extra_files, reloader_interval, reloader_type) Traceback (most recent call last): File "/home/hemopheno/mysite/HemoPheno4HFMain.py", line 3, in <module> from Main import * File "./Main.py", line 9, in <module> from MVDD.MVDD import MVDD File "./MVDD/MVDD.py", line 10, in <module> import networkx as nx File "/usr/lib/python3.8/site-packages/networkx/init.py", line 112, in <module> import networkx.generators File "/usr/lib/python3.8/site-packages/networkx/generators/init.py", line 8, in <module> from networkx.generators.community import * File "/usr/lib/python3.8/site-packages/networkx/generators/community.py", line 20, in <module> from scipy.special import zeta as _zeta File "/usr/lib/python3.8/site-packages/scipy/init.py", line 62, in <module> from numpy import show_config as show_numpy_config File "/usr/lib/python3.8/site-packages/numpy/init.py", line 142, in <module> from . import core File "/usr/lib/python3.8/site-packages/numpy/core/init.py", line 17, in <module> from . import multiarray File "/usr/lib/python3.8/site-packages/numpy/core/multiarray.py", line 14, in <module> from . import overrides File "/usr/lib/python3.8/site-packages/numpy/core/overrides.py", line 16, in <module> add_docstring( RuntimeError: implement_array_function method already has a docstring

We attempted to upgrade our numpy to the latest version, and while that removed our error, we are still receiving an internal server error. Any help or ideas as to what could be causing this would be greatly appreciated.

It looks like you're trying to launch the Flask development server inside a console -- perhaps by using the "Run" button in the editor?

You don't need to do that on PythonAnywhere; once you have set up your website on the "Web" page then our systems will automatically start it when requests come in. See this help page for more information.

Unfortunately, that isn't it. I actually run the server by deployment through the web tab in PythonAnywhere. I run the main program just as a preliminary bug check. The problem is is that whenever I do a POST request, I receive an internal server error, and have no idea why, because on my local machine in that dev enviroment it runs perfectly fine. It is specifically after being deployed to the server that we begin to have troubles. You can check it out here: http://hemopheno.pythonanywhere.com/

its a simple-ish website that simply takes some number input and then is supposed to show an image after.

If you want to see stacktraces for internal server error pages, you can look at the error log for your website. There's a link to it on the "Web" page, and the most recent error will be at the bottom of the file.

You saved my butt bigtime, really appreciate it!!!

No problem, glad to help!