본문 바로가기
python

pip install 오류 (python)

by signature95 2022. 3. 6.
728x90
반응형

최근 이런 문제가 많이 발견되었습니다.

 

가령, yfinace를 다운받고 해당 메세지를 출력받았는데..

!pip3 install yfinance

>>>

DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: yfinance in /usr/local/lib/python3.9/site-packages (0.1.69)
Requirement already satisfied: pandas>=0.24 in /usr/local/lib/python3.9/site-packages (from yfinance) (1.3.4)
Requirement already satisfied: numpy>=1.15 in /usr/local/lib/python3.9/site-packages (from yfinance) (1.21.3)
Requirement already satisfied: requests>=2.26 in /usr/local/lib/python3.9/site-packages (from yfinance) (2.26.0)
Requirement already satisfied: multitasking>=0.0.7 in /usr/local/lib/python3.9/site-packages (from yfinance) (0.0.10)
Requirement already satisfied: lxml>=4.5.1 in /usr/local/lib/python3.9/site-packages (from yfinance) (4.6.4)
Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.9/site-packages (from pandas>=0.24->yfinance) (2.8.2)
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.9/site-packages (from pandas>=0.24->yfinance) (2021.3)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests>=2.26->yfinance) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/site-packages (from requests>=2.26->yfinance) (2.0.9)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests>=2.26->yfinance) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests>=2.26->yfinance) (1.26.7)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/site-packages (from python-dateutil>=2.7.3->pandas>=0.24->yfinance) (1.16.0)
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621

 

막상 import하면 no module 에러가 발생하는 것이죠

이와 관련해서 stack overflow 등 다양한 사례를 살펴보았지만, 유의하게 해결하진 못하였습니다.

짐작해보면, python 내부에서 여러 버전이 충돌해서 생긴 오류인듯 했는데, 이를 해결하려면 초기화를 진행하고 다시 설치하는 방법 뿐이었습니다.

 

따라서 제가 시도한 방법은 가상환경입니다.

2021.11.15 - [python] - 가상환경 만들기 (Mac)

 

가상환경 만들기 (Mac)

가상환경을 설치하기 위해선 먼저 파이썬을 설치해야 합니다. https://www.python.org/downloads/ Download Python The official home of the Python Programming Language www.python.org 를 통해서 파이썬을 설..

signature95.tistory.com

과거에 포스트한 자료를 바탕으로 새롭게 시도해보았습니다.

 

해당 폴더에 접근한 후 virtualenv를 설치하고 soruce bin/acivate한 후에 가상환경을 시행하였습니다.

 

그리고 나서

이렇게 yfinance를 터미널에서 설치한 결과,

다행히 이상없이 시행된 것을 확인할 수 있었습니다.

728x90

'python' 카테고리의 다른 글

오류 해결 코드 (ROC_AUC_score) python  (0) 2022.04.18
가상환경 만들기 (Mac)  (0) 2021.11.15
VScode 설치 및 확장팩  (0) 2021.11.14
티스토리 시작에 앞서  (0) 2021.11.14

댓글