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 importing package paramiko #1288

Closed
ReenaAcharya opened this issue Sep 10, 2018 · 9 comments
Closed

Error importing package paramiko #1288

ReenaAcharya opened this issue Sep 10, 2018 · 9 comments

Comments

@ReenaAcharya
Copy link

Hi,

I installed paramiko using "pip install paramiko".
When I am trying to import paramiko "import paramiko" I am getting following error:-
"
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/init.py", line 22, in
from paramiko.transport import SecurityOptions, Transport
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/transport.py", line 57, in
from paramiko.ed25519key import Ed25519Key
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/ed25519key.py", line 22, in
import nacl.signing
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nacl/signing.py", line 19, in
import nacl.bindings
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nacl/bindings/init.py", line 17, in
from nacl.bindings.crypto_box import (
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nacl/bindings/crypto_box.py", line 18, in
from nacl._sodium import ffi, lib
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nacl/_sodium.so, 2): Symbol not found: _crypto_box
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nacl/_sodium.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nacl/_sodium.so"

I have checked the pramiko directory and all files are present including transport.py.
I am using MacOS.

Any help here would be appreciated.

Thanks & Regards,
Reena Acharya

@ploxiln
Copy link
Contributor

ploxiln commented Sep 10, 2018

This is a problem importing a dependency of paramiko, "nacl", a different python module. You could try to uninstall nacl and re-install it.

@ReenaAcharya
Copy link
Author

Hi,

Thanks for reply. I installed nacl using "brew install nacl".
When I do "import paramiko" still I am getting above errors.

Thanks & Regards,
Reena Acharya

@ploxiln
Copy link
Contributor

ploxiln commented Sep 11, 2018

Ah, right, sorry, I mean "pynacl" https://pypi.org/project/PyNaCl/

@ReenaAcharya
Copy link
Author

Hi,

I have pynacl already installed.

Thanks & Regards,
Reena Acharya

@ploxiln
Copy link
Contributor

ploxiln commented Sep 11, 2018

Yes, you have pynacl installed, but it's apparently broken somehow and fails to import. So the original suggestion was to uninstall it and reinstall it.

Your original problem is with pynacl, not with paramiko.

@ReenaAcharya
Copy link
Author

Hi,

I tried uninstalling and installing pynacl. When I did "import paramiko" I am getting errors.
I used the below commands for pynacl:-

  1. pip uninstall pynacl
  2. pip install pynacl
    After doing this I got error for paramiko, so I followed a link which had a link download the tar file got pynacl and install it.I tried that also but still getting importing error for paramiko.
    Do you have any link or any other command I can use to fix pynacl stuff.

Thanks & Regards,
Reena Acharya

@ploxiln
Copy link
Contributor

ploxiln commented Sep 11, 2018

You could provide verbose terminal output from installing pynacl (pip install --verbose pynacl). You may get better help from https://github.com/pyca/pynacl

@ReenaAcharya
Copy link
Author

Hi,

Attaching output of command pip install --verbose pynacl

Thanks & Regards,
Reena Acharya

output.txt

@bitprophet
Copy link
Member

bitprophet commented Sep 12, 2018

That seems to be getting you PyNacl 1.2.1 which is the same version I have locally, and it works on my end. This makes me suspect perhaps your underlying libnacl or libffi versions are incompatible with whatever PyNaCl requires. Normally the Python wrapper for a low level library should notice such things at install time, but there are always issues...

You may want to try completely uninstalling and reinstalling your Paramiko environment, or try using a separate Python environment besides the macOS default (which can sometimes have issues) - for example pyenv.

Otherwise, I would go check the install documentation and FAQs for https://pynacl.readthedocs.io/en/stable/ as they are the intermediate dependency here; this is not something Paramiko itself has any direct control over :( good luck! I am closing the issue as not-actionable but discussion is not locked.

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

3 participants