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

MDsrv on raspberry pi #48

Open
sperezconesa opened this issue Apr 14, 2020 · 25 comments
Open

MDsrv on raspberry pi #48

sperezconesa opened this issue Apr 14, 2020 · 25 comments

Comments

@sperezconesa
Copy link

Hello,
I am trying to use MDsrv on a raspberry pi server. Since the raspberry pi has ARM architecture it cannot use all of mdtrajs features since a lot of them are hardware accelerated. Does MDsrv use mdtraj extensively or just to load structures, which should work on the pi? In addition, is there a version or some posibility to use MDAnalysis rather than mdtraj which might be more compatible.
Thank you very much for your help,
Sergio

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 19, 2020

Hey Sergio,

you can just use MDAnalysis, we used mdtraj as a lighter version but MDAnalysis is now quite powerful and covers mostly all file formats. And yes, we only use it to read the coordinates.
I could make it work (last year) to run on a raspberry but would be great if you feedback how it is working for you!

Cheers,
Johanna

@sperezconesa
Copy link
Author

I commented-out a few functions in mdtraj and installed it. I've been able to install MDAnalysis. I will try to see if it works fine and keep you posted.

@sperezconesa
Copy link
Author

Hello,
I am getting this error:

[Thu Apr 23 11:41:00.698469 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620] mod_wsgi (pid=1406): Exception occurred processing WSGI script '/var/www/mdsrv/mdsrv.wsgi'.
[Thu Apr 23 11:41:00.698547 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620] Traceback (most recent call last):
[Thu Apr 23 11:41:00.698617 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]   File "/var/www/mdsrv/mdsrv.wsgi", line 28, in <module>
[Thu Apr 23 11:41:00.698759 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]     from mdsrv import app as application
[Thu Apr 23 11:41:00.698797 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]   File "/home/sperez/mdsrv/mdsrv/__init__.py", line 8, in <module>
[Thu Apr 23 11:41:00.698851 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]     from .mdsrv import *
[Thu Apr 23 11:41:00.698881 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]   File "/home/sperez/mdsrv/mdsrv/mdsrv.py", line 23, in <module>
[Thu Apr 23 11:41:00.698934 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]     from .trajectory import *
[Thu Apr 23 11:41:00.698964 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]   File "/home/sperez/mdsrv/mdsrv/trajectory.py", line 10, in <module>
[Thu Apr 23 11:41:00.699020 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]     import numpy as np
[Thu Apr 23 11:41:00.699050 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/numpy/__init__.py", line 140, in <module>
[Thu Apr 23 11:41:00.699106 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620]     from . import _distributor_init
[Thu Apr 23 11:41:00.699170 2020] [wsgi:error] [pid 1406] [remote 192.168.0.100:52620] ImportError: cannot import name _distributor_init

Can anyone help me?

@sperezconesa
Copy link
Author

By the way, running mdsrv just on the terminal works fine.

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 23, 2020

hm, that looks like a numpy error - could you check if that is individually working? (and while you're on it, it's also good, as a backup, to check if MDAnalysis is working or missing some dependencies ;-))

@sperezconesa
Copy link
Author

On the commandline, mdsrv works fine so MDAnalysis must be fine. Numpy can be imported on the commandline too and I have tried doing some simple calculations and they look fine...
The command:

from numpy import _distributor_init

works fine too.

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 23, 2020

just for clarification, you can start the MDsrv from the command line & visualize & run simulations from there but have problems with the deployment?

Can you also check if you have different numpy versions installed? might be a dependency problem still... But strange...

MDAnalysis can still have some dependency problems which do not arise when you just import it (bug on their side). That's why I recommend trying to import MDAnalysis and e.g. check the version of it. When that works, this is of course not the problem (quite often so far it was the main problem that's why I posted it also here).

@sperezconesa
Copy link
Author

On the commandline I can visualize simulations by calling mdsvr. So it must be the deployment.

MDAnalysis seems to be able to load trajectories fine in the commandline.

I will workout the numpy versions problem, I am not sure how to check this. I am using a virtual-environment which I thought would take care of this.

@sperezconesa
Copy link
Author

In the environment and on the system I have numpy 1.18.3. Perhaps the problem is that it is using python2 which I have also installed.

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 24, 2020

oh yes, python2 can be an issue! MDAnalysis only works with python3, so a mixup could result in not being able to run it. Still strange with having the virtual env.

@sperezconesa
Copy link
Author

It seems that it was using the systems's python binary which is python2. I don't know why it was picking it up. I made some changes and I don't know how, I fixed it.

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 27, 2020

okay, that sounds great! I totally forgot to mention, for the deployment, you have to set your virtual environment correctly (in the wsgi file) - maybe there an error occurred too.

Of note - how is it running on your raspberry?

@sperezconesa
Copy link
Author

I haven't tried much because I am getting an error when loading a trajectory. This is using mdtraj with commented stuff. I import a .gro file and then onto it I import an .xtc. But when I hit the play button I get this error:

[Mon Apr 27 09:01:09.058109 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889] ERROR:mdsrv.mdsrv:Exception on /traj/frame/0/examplepath/step0.xtc [POST]
[Mon Apr 27 09:01:09.058247 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889] Traceback (most recent call last):
[Mon Apr 27 09:01:09.058283 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
[Mon Apr 27 09:01:09.058320 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     response = self.full_dispatch_request()
[Mon Apr 27 09:01:09.058352 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
[Mon Apr 27 09:01:09.058385 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     rv = self.handle_user_exception(e)
[Mon Apr 27 09:01:09.058417 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
[Mon Apr 27 09:01:09.058453 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     reraise(exc_type, exc_value, tb)
[Mon Apr 27 09:01:09.058484 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
[Mon Apr 27 09:01:09.058516 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     rv = self.dispatch_request()
[Mon Apr 27 09:01:09.058550 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
[Mon Apr 27 09:01:09.058584 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     return self.view_functions[rule.endpoint](**req.view_args)
[Mon Apr 27 09:01:09.058616 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/mdsrv/mdsrv.py", line 91, in decorated
[Mon Apr 27 09:01:09.058649 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     return f( *args, **kwargs )
[Mon Apr 27 09:01:09.058681 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/mdsrv/mdsrv.py", line 139, in wrapped_function
[Mon Apr 27 09:01:09.058714 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     resp = make_response( f( *args, **kwargs ) )
[Mon Apr 27 09:01:09.058746 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/mdsrv/mdsrv.py", line 299, in traj_frame
[Mon Apr 27 09:01:09.058778 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     return TRAJ_CACHE.get( path, struc_path ).get_frame_string(
[Mon Apr 27 09:01:09.058831 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/mdsrv/trajectory.py", line 122, in get
[Mon Apr 27 09:01:09.058958 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     self.add( path, pathList, struc_path )
[Mon Apr 27 09:01:09.058992 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/mdsrv/trajectory.py", line 104, in add
[Mon Apr 27 09:01:09.059026 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     self.cache[ path ] = TrajectoryCollection( pathList, struc_path )
[Mon Apr 27 09:01:09.059060 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]   File "/home/sperez/mdsrv_env/lib/python3.7/site-packages/mdsrv/trajectory.py", line 200, in __init__
[Mon Apr 27 09:01:09.059093 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889]     self.box = self.parts[ 0 ].box
[Mon Apr 27 09:01:09.059124 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889] AttributeError: 'NoneType' object has no attribute 'box'
[Mon Apr 27 09:01:09.061606 2020] [wsgi:error] [pid 2381] [remote 192.168.0.100:51889] Exception AttributeError: "'NoneType' object has no attribute '__del__'" in <bound method TrajectoryCollection.__del__ of <mdsrv.trajectory.TrajectoryCollection object at 0x68f06c30>> ignore

I am not sure if have commented out too many thing of mdtraj (this is the reason I am trying to use mdanalysis which is not hardware accelerated).

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 27, 2020

To comment mdtraj out, you can just set

try:
    import mdtraj as md
    from mdtraj.formats import *
    importarray[0] = True
    importarray[2] = True

both to False .

I guess the trajectory is fine (MDsrv out of raspberry is running it - or you took one from the example directory) & also MDAnalysis is working from python (e.g. MDAnalysis.__version__ )?

If that's all fine (plz check!), give me your installation protocol/environment, aso, so I can try to reproduce the error on my Raspberry.

@sperezconesa
Copy link
Author

sperezconesa commented Apr 27, 2020

In which file is this? I don't see it in setup.py.
(Nevermind I found it. Somedays I can't even grep right)

@sperezconesa
Copy link
Author

I get the same problem on the commandline. I only checked a single structure on the commandline, last time.

@sperezconesa
Copy link
Author

I have installed mdsrv with mdanalysis properly and now on the commandline I can import trajectories. But now I have again the problem with numpy in the deployment which I don't understand at all. It seems not to be the python2 thing because I removed the systems python2 binary and the problem remained...

@sperezconesa
Copy link
Author

Since I don't know how I fixed it last time. I don't know how to fix it now.

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 27, 2020

okay - can you check /var/log/apache2/error.log ? When it's related to the deployment, we should get more info there. Also, please check the paths in your wsgi & that you use the right apache2 & wsgi!

@sperezconesa
Copy link
Author

I am pretty sure it is the deployment that is not setting up the right the environment or picking up things from where it shouldn't. On the commandline it still works fine. In the wsgi I have:
APP_ENV = '/home/sperez/mdsrv/mdsrv_env_mda/bin/'
And in apache.config:
python-path=/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/

The output of /var/log/apache2/error.log is

[Tue Apr 28 09:56:08.181303 2020] [mpm_event:notice] [pid 1475:tid 1996300816] AH00489: Apache/2.4.38 (Raspbian) mod_wsgi/4.6.5 Python/2.7 configured -- resuming normal operations
[Tue Apr 28 09:56:08.181733 2020] [core:notice] [pid 1475:tid 1996300816] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 28 09:56:12.552376 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] mod_wsgi (pid=1477): Failed to exec Python script file '/var/www/mdsrv/mdsrv.wsgi'.
[Tue Apr 28 09:56:12.552500 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] mod_wsgi (pid=1477): Exception occurred processing WSGI script '/var/www/mdsrv/mdsrv.wsgi'.
[Tue Apr 28 09:56:12.552569 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] Traceback (most recent call last):
[Tue Apr 28 09:56:12.552628 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   File "/var/www/mdsrv/mdsrv.wsgi", line 29, in <module>
[Tue Apr 28 09:56:12.552847 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]     from mdsrv import app as application
[Tue Apr 28 09:56:12.552884 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/mdsrv/__init__.py", line 8, in <module>
[Tue Apr 28 09:56:12.552996 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]     from .mdsrv import *
[Tue Apr 28 09:56:12.553029 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/mdsrv/mdsrv.py", line 23, in <module>
[Tue Apr 28 09:56:12.553461 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]     from .trajectory import *
[Tue Apr 28 09:56:12.553494 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/mdsrv/trajectory.py", line 10, in <module>
[Tue Apr 28 09:56:12.554097 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]     import numpy as np
[Tue Apr 28 09:56:12.554131 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
[Tue Apr 28 09:56:12.554433 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]     from . import core
[Tue Apr 28 09:56:12.554465 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/numpy/core/__init__.py", line 54, in <module>
[Tue Apr 28 09:56:12.554677 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]     raise ImportError(msg)
[Tue Apr 28 09:56:12.554744 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] ImportError: 
[Tue Apr 28 09:56:12.554760 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] 
[Tue Apr 28 09:56:12.554774 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
[Tue Apr 28 09:56:12.554789 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] 
[Tue Apr 28 09:56:12.554802 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] Importing the numpy c-extensions failed.
[Tue Apr 28 09:56:12.554815 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] - Try uninstalling and reinstalling numpy.
[Tue Apr 28 09:56:12.554829 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] - If you have already done that, then:
[Tue Apr 28 09:56:12.554843 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   1. Check that you expected to use Python2.7 from "",
[Tue Apr 28 09:56:12.554857 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]      and that you have no directories in your PATH or PYTHONPATH that can
[Tue Apr 28 09:56:12.554871 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]      interfere with the Python and numpy version "1.18.3" you're trying to use.
[Tue Apr 28 09:56:12.554950 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   2. If (1) looks fine, you can open a new issue at
[Tue Apr 28 09:56:12.554965 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]      https://github.com/numpy/numpy/issues.  Please include details on:
[Tue Apr 28 09:56:12.554980 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]      - how you installed Python
[Tue Apr 28 09:56:12.554993 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]      - how you installed numpy
[Tue Apr 28 09:56:12.555006 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]      - your operating system
[Tue Apr 28 09:56:12.555020 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]      - whether or not you have multiple versions of Python installed
[Tue Apr 28 09:56:12.555034 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]      - if you built from source, your compiler versions and ideally a build log
[Tue Apr 28 09:56:12.555048 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] 
[Tue Apr 28 09:56:12.555061 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] - If you're working with a numpy git repository, try `git clean -xdf`
[Tue Apr 28 09:56:12.555075 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305]   (removes all files not under version control) and rebuild numpy.
[Tue Apr 28 09:56:12.555089 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] 
[Tue Apr 28 09:56:12.555101 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] Note: this error has many possible causes, so please don't comment on
[Tue Apr 28 09:56:12.555115 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] an existing issue about this - open a new one instead.
[Tue Apr 28 09:56:12.555129 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] 
[Tue Apr 28 09:56:12.555142 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] Original error was: No module named _multiarray_umath
[Tue Apr 28 09:56:12.555155 2020] [wsgi:error] [pid 1477:tid 1967637536] [remote 192.168.0.100:62305] 
[Tue Apr 28 09:56:12.562930 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306] mod_wsgi (pid=1477): Failed to exec Python script file '/var/www/mdsrv/mdsrv.wsgi'.
[Tue Apr 28 09:56:12.563019 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306] mod_wsgi (pid=1477): Exception occurred processing WSGI script '/var/www/mdsrv/mdsrv.wsgi'.
[Tue Apr 28 09:56:12.563078 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306] Traceback (most recent call last):
[Tue Apr 28 09:56:12.563141 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]   File "/var/www/mdsrv/mdsrv.wsgi", line 29, in <module>
[Tue Apr 28 09:56:12.563229 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]     from mdsrv import app as application
[Tue Apr 28 09:56:12.563262 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/mdsrv/__init__.py", line 8, in <module>
[Tue Apr 28 09:56:12.563318 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]     from .mdsrv import *
[Tue Apr 28 09:56:12.563349 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/mdsrv/mdsrv.py", line 23, in <module>
[Tue Apr 28 09:56:12.563405 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]     from .trajectory import *
[Tue Apr 28 09:56:12.563435 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/mdsrv/trajectory.py", line 10, in <module>
[Tue Apr 28 09:56:12.563535 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]     import numpy as np
[Tue Apr 28 09:56:12.563565 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]   File "/home/sperez/mdsrv/mdsrv_env_mda/lib/python3.7/site-packages/numpy/__init__.py", line 140, in <module>
[Tue Apr 28 09:56:12.563620 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306]     from . import _distributor_init
[Tue Apr 28 09:56:12.563677 2020] [wsgi:error] [pid 1477:tid 1934066720] [remote 192.168.0.100:62306] ImportError: cannot import name _distributor_init

I have no idea where this python2.7 comes from... I have removed the python2 binaries from /usr/bin.

What do you mean by

that you use the right apache2 & wsgi

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 28, 2020

looks like you're using mod_wsgi of python2:

[Tue Apr 28 09:56:08.181303 2020] [mpm_event:notice] [pid 1475:tid 1996300816] AH00489: Apache/2.4.38 (Raspbian) mod_wsgi/4.6.5 Python/2.7 configured -- resuming normal operations

Could you re-install that (check for reference this link)?

@sperezconesa
Copy link
Author

I have done this and now I get this other error. By the way, thanks a lot for your patience and help.

[Tue Apr 28 20:29:07.860795 2020] [mpm_event:notice] [pid 28536:tid 1996001808] AH00489: Apache/2.4.38 (Raspbian) mod_wsgi/4.6.5 Python/3.7 configured --
 resuming normal operations
[Tue Apr 28 20:29:07.908068 2020] [core:notice] [pid 28536:tid 1996001808] AH00094: Command line: '/usr/sbin/apache2'
[Tue Apr 28 20:29:12.799013 2020] [wsgi:error] [pid 28537:tid 1931588640] [remote 192.168.0.100:49256] mod_wsgi (pid=28537): Failed to exec Python script
 file '/var/www/mdsrv/mdsrv.wsgi'.
[Tue Apr 28 20:29:12.799498 2020] [wsgi:error] [pid 28537:tid 1931588640] [remote 192.168.0.100:49256] mod_wsgi (pid=28537): Exception occurred processin
g WSGI script '/var/www/mdsrv/mdsrv.wsgi'.
[Tue Apr 28 20:29:12.801049 2020] [wsgi:error] [pid 28537:tid 1931588640] [remote 192.168.0.100:49256] Traceback (most recent call last):
[Tue Apr 28 20:29:12.801273 2020] [wsgi:error] [pid 28537:tid 1931588640] [remote 192.168.0.100:49256]   File "/var/www/mdsrv/mdsrv.wsgi", line 20, in <m
odule>
[Tue Apr 28 20:29:12.801317 2020] [wsgi:error] [pid 28537:tid 1931588640] [remote 192.168.0.100:49256]     if sys.version_info[0] > (3,):
[Tue Apr 28 20:29:12.801453 2020] [wsgi:error] [pid 28537:tid 1931588640] [remote 192.168.0.100:49256] TypeError: '>' not supported between instances of 
'int' and 'tuple'
[Tue Apr 28 20:29:12.815199 2020] [wsgi:error] [pid 28537:tid 1965159456] [remote 192.168.0.100:49257] mod_wsgi (pid=28537): Failed to exec Python script
 file '/var/www/mdsrv/mdsrv.wsgi'.
[Tue Apr 28 20:29:12.815753 2020] [wsgi:error] [pid 28537:tid 1965159456] [remote 192.168.0.100:49257] mod_wsgi (pid=28537): Exception occurred processin
g WSGI script '/var/www/mdsrv/mdsrv.wsgi'.

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 29, 2020

ups, there is a [0], which should not be there...
So change the wsgi to either
if sys.version_info > (3,):
or to
if sys.version_info[0] >= 3:

Where did you take the wsgi from (wiki or from the mdsrv.wsgi.sample from here https://github.com/arose/mdsrv/blob/master/mdsrv.wsgi.sample)? Need to update that ;-)

And sure, I'm happy to help (sorry when replies sometimes take a bit 😅

@sperezconesa
Copy link
Author

Don't worry you are being very responsive. Now it works! I took it from http://nglviewer.org/mdsrv/installation.html#quickinstall

@j0kaso
Copy link
Collaborator

j0kaso commented Apr 29, 2020

Nice! 🎉

Thanks for the reference - will update that file!

Let me know if something else comes up - also how it's running for you (I had back then some issues with the resolution but I only have an old raspberry pi).

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