I am using the Anaconda environment for python.
I have installed the paramiko (v. 2.0.2) and cryptography (v 1.5) modules using the Anaconda Navigator..
When I try to execute this import statement:
import netmiko
I get an error message "ImportError: No module named cryptography.hazmat.backends"
The total output in the cmd window is:
>>> import netmiko
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\__init__.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\ssh_dispatcher.py", line 3, in <module>
File "build\bdist.win-amd64\egg\netmiko\cisco\__init__.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\cisco\cisco_ios_ssh.py", line 1, in <module>
File "build\bdist.win-amd64\egg\netmiko\ssh_connection.py", line 3, in <module>
File "build\bdist.win-amd64\egg\netmiko\base_connection.py", line 13, in <module>
File "build\bdist.win-amd64\egg\paramiko\__init__.py", line 30, in <module>
File "build\bdist.win-amd64\egg\paramiko\transport.py", line 32, in <module>
ImportError: No module named cryptography.hazmat.backends
Does anyone know how to fix this?
Any help is appreciated.
I guess the right order for the commands would be:
#apt-get update
#apt-get install python-dev
#apt-get install libffi-dev
#pip install cryptography
It solved the issue in my case
You're probably running into a problem because you don't have libffi-dev installed. Installing "python-dev" and "libffi-dev" at the OS layer may help.
Related
Traceback (most recent call last):
File "/home/mohit/anaconda3/bin/jupyter-notebook", line 7, in
from notebook.notebookapp import main
File "/home/mohit/anaconda3/lib/python3.8/site-packages/notebook/notebookapp.py", line 83, in
from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager
File "/home/mohit/anaconda3/lib/python3.8/site-packages/notebook/services/kernels/kernelmanager.py", line 18, in
from jupyter_client.session import Session
File "/home/mohit/anaconda3/lib/python3.8/site-packages/jupyter_client/session.py", line 41, in
from jupyter_client.jsonutil import extract_dates, squash_dates, date_default
File "/home/mohit/anaconda3/lib/python3.8/site-packages/jupyter_client/jsonutil.py", line 10, in
from dateutil.parser import parse as _dateutil_parse
File "/home/mohit/anaconda3/lib/python3.8/site-packages/dateutil/parser.py", line 158
l.append("%s=%s" % (attr, `value`))
^
SyntaxError: invalid syntax
pip install python-dateutil --upgrade will solve your problem
when I am installing a package in python 3.6.5 an error occurs:
"ImportError: cannot import name 'HIDE_CURSOR'"
command: pip install
pip install glob Traceback (most recent call last): File
"c:\python\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec) File "c:\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals) File "C:\python\Scripts\pip.exe__main__.py", line 5, in File
"c:\python\lib\site-packages\pip_internal__init__.py", line 40, in
from pip._internal.cli.autocompletion import autocomplete File "c:\python\lib\site-packages\pip_internal\cli\autocompletion.py",
line 8, in
from pip._internal.cli.main_parser import create_main_parser File "c:\python\lib\site-packages\pip_internal\cli\main_parser.py",
line 8, in
from pip._internal.cli import cmdoptions File "c:\python\lib\site-packages\pip_internal\cli\cmdoptions.py", line
24, in
from pip._internal.utils.ui import BAR_TYPES File "c:\python\lib\site-packages\pip_internal\utils\ui.py", line 11, in
from pip._vendor.progress import HIDE_CURSOR, SHOW_CURSOR ImportError: cannot import name 'HIDE_CURSOR'
Any help is appreciated.
I simply reinstalled pip by downloading pip from here and reinstalled using cmd python get-pip.pyonce in the directory.
Thats all that seemed to work for me, hope you get it sorted!
I read where running installing pyqt5 or pip install pyqt5 would correct this error. Did not work for my enviornment. Any suggestions?
Traceback (most recent call last):
File "C:\Users\Paula\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 10, in
import sqlite3
File "C:\Users\Paula\Anaconda3\lib\sqlite3\__init__.py", line 23, in
from sqlite3.dbapi2 import *
File "C:\Users\Paula\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Paula\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\Paula\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 86, in
from .services.sessions.sessionmanager import SessionManager
File "C:\Users\Paula\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 13, in
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'
I am trying to import distributed version 1.22.0 installed with pip3.
However, I get this error :
>>> import distributed
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/distributed/__init__.py", line 5, in <module>
from .core import connect, rpc
File "/usr/local/lib/python3.6/dist-packages/distributed/core.py", line 25, in <module>
from .system_monitor import SystemMonitor
File "/usr/local/lib/python3.6/dist-packages/distributed/system_monitor.py", line 4, in <module>
import psutil
File "/home/users/ej/.local/lib/python3.6/site-packages/psutil/__init__.py", line 100, in <module>
from . import _pslinux as _psplatform
File "/home/users/ej/.local/lib/python3.6/site-packages/psutil/_pslinux.py", line 26, in <module>
from . import _psutil_linux as cext
ImportError: /home/users/ej/.local/lib/python3.6/site-packages/psutil/_psutil_linux.cpython-36m-x86_64-linux-gnu.so: failed to map segment from shared object
>>>
I have dask version 0.18.1 installed with pip3.
I work on Ubuntu 18.04 with python3.
I tried reinstall and install but no solution.
Could you help me please ?
Thanks in advance.
I am trying to make a portable application from a python app I developped on Windows 7 - 32 bits using python3.4. My first idea was to use py2exe combined with a ThinApp equivalent, but as I use rasterio which is not a pure python library, py2exe does not manage to find some DLLs.
If I try to run the generated executable I get this error :
File Traceback (most recent call last):
File "viewer.py", line 3, in <module>
import MainWindow as GUI
File "C:\Users\IEUser\Documents\viewer-dev\viewer\MainWindow.py", line 2, in <module>
import ImageWindow
File "C:\Users\IEUser\Documents\viewer-dev\viewer\ImageWindow.py", line 1, in <module>
import Resampler
File "C:\Users\IEUser\Documents\viewer-dev\viewer\Resampler.py", line 1, in <module>
import rasterio
File "C:\Python34\lib\site-packages\rasterio\__init__.py", line 31, in <module>
from rasterio._base import gdal_version
File "<loader>", line 10, in <module>
File "<loader>", line 8, in __load
ImportError: (DLL load failed: The specified module could not be found.) 'C:\\Users\\IEUser\\Documents\\viewer-dev\\dist\\rasterio._base.pyd'
I read that I had to add these DLLs manually in the dist directory, but I wonder how could I get a list of the required DLLs ?
You can use the Dependency Walker on your py2exe to see all the missing dependencies.
Check the executable and all the linked libraries(PYD & DLL files)