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

ImportError: No module named _sodium #141

Closed
ibohonos opened this issue Apr 26, 2019 · 4 comments
Closed

ImportError: No module named _sodium #141

ibohonos opened this issue Apr 26, 2019 · 4 comments

Comments

@ibohonos
Copy link

ibohonos commented Apr 26, 2019

ImportError: No module named _sodium
If i load app in localhost, all worked.
But if i run on server from apache try this error.
System: Ubuntu 18.10
Python: 3.6.7
pip 9.0.1 from /home/sites/web/matcha.vuetube.top/private/venv/lib/python3.6/site-packages (python 3.6)
Log:

mod_wsgi (pid=5650): Target WSGI script '/home/sites/web/matcha.vuetube.top/public_html/app.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=5650): Exception occurred processing WSGI script '/home/sites/web/matcha.vuetube.top/public_html/app.wsgi'.
Traceback (most recent call last):
File "/home/sites/web/matcha.vuetube.top/public_html/app.wsgi", line 7, in <module>
from app import app as application
File "/home/sites/web/matcha.vuetube.top/public_html/app/__init__.py", line 10, in <module>
from pusher import Pusher
File "/home/sites/web/matcha.vuetube.top/private/venv/lib/python3.6/site-packages/pusher/__init__.py", line 3, in <module>
from .pusher import Pusher
File "/home/sites/web/matcha.vuetube.top/private/venv/lib/python3.6/site-packages/pusher/pusher.py", line 21, in <module>
from pusher.pusher_client import PusherClient
File "/home/sites/web/matcha.vuetube.top/private/venv/lib/python3.6/site-packages/pusher/pusher_client.py", line 32, in <module>
from pusher.crypto import *
File "/home/sites/web/matcha.vuetube.top/private/venv/lib/python3.6/site-packages/pusher/crypto.py", line 18, in <module>
import nacl.secret
File "/home/sites/web/matcha.vuetube.top/private/venv/lib/python3.6/site-packages/nacl/secret.py", line 17, in <module>
import nacl.bindings
File "/home/sites/web/matcha.vuetube.top/private/venv/lib/python3.6/site-packages/nacl/bindings/__init__.py", line 17, in <module>
from nacl.bindings.crypto_aead import (
File "/home/sites/web/matcha.vuetube.top/private/venv/lib/python3.6/site-packages/nacl/bindings/crypto_aead.py", line 18, in <module>
from nacl._sodium import ffi, lib
ImportError: No module named _sodium
@kn100
Copy link

kn100 commented Apr 29, 2019

It sounds like the underlying system library is missing. Assuming your server runs Ubuntu, try running sudo apt-get install libsodium23 on the server in question :)

@ibohonos
Copy link
Author

ibohonos commented May 2, 2019

Server in Ubuntu, but this library is installed.

@WillSewell
Copy link
Contributor

Unfortunately I am unable to reproduce this issue with the following Dockerfile

FROM ubuntu:18.10

RUN apt-get update -qy && apt-get upgrade -qy
RUN apt-get install -qy python3 python3-pip
RUN pip3 install pusher

And then running

python3 -c "import pusher"

It looks like the error is due to a failing internal import in the PyNaCl library. This seems odd. I would try reinstalling the library to see if that helps.

I'll close this issue as I am unable to reproduce it, so I cannot be of much help. If you are able to send a reproducible example, then feel free to re-open the issue.

@sailfish009
Copy link

pip uninstall and re-install pynacl, solved the problem.

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

4 participants