paramiko import 오류 해결

sosimeow·2022년 9월 29일
0

Python

목록 보기
1/2
post-thumbnail

python 에서 원격 접속을 위해 paramiko 를 설치하고 import 하려는데 아래와 같은 오류가 발생했다.

import error

dll load failed while importing _openssl: 지정된 모듈을 찾을 수 없습니다.

해결해보자



1. anaconda local folder 내 Library/bin 아래에서

openssl.exe, openssl.pdb 를 복사해서 사용 중인 env 에 옮기기

https://gentlesark.tistory.com/113



2. openssl 재설치

conda install -c conda-forge openssl
>>> import paramiko
C:\Users\Catalonix\anaconda3\envs\tf\lib\site-packages\paramiko\transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated
  "class": algorithms.Blowfish,

기존에는 conda install 로 설치했다면, anaconda org 에서 검색해 conda-forge 버전으로 openssl 패키지를 설치했다

재설치 후 import 하니 위와 다른 cryptography 로 인한 오류가 발생했다.



3. cryptography 삭제 후 재 설치

conda uninstall -y crytography
conda install crytography==36.0.2

오류 내용이 아래 github issue 와 동일하여 임시 해결책을 똑같이 적용했더니 paramiko 가 정상적으로 import 되었다

https://github.com/paramiko/paramiko/issues/2038




vscode error

anaconda prompt 에서는 paramiko 가 잘 import 되는데, vscode 에서는 안되어서 terminal: select default profile 을 command 로 바꾸어 주니 해결됐다.

https://xlog.tistory.com/20

profile
데이터 엔지니어 ing

0개의 댓글