[스토리모드] Prophet 설치과정

Seongkeun·2022년 12월 8일
1

Python

목록 보기
1/8
post-thumbnail

이 글에서는..

이 글에서는 Python 3.9 버전을 고집하며 Prophet 을 사용하려고 시도한 흔적만을 담았습니다(Trouble Shooting Story). 바로 Prophet 사용하는 방법을 원하시는 분은 Prophet 설치 로 들어가셔서 확인해 주세요

Prophet이란?

페이스북 연구팀의 션 테일러와 벤 레담은 블로그 포스트를 통해 “프로핏은 전문가는 물론 비전문가도 높은 품질의 예측 작업을 좀 더 쉽게 할 수 있는 툰”이라며, “예측들을 비전문가에게 직관적인 방식으로 맞춤화할 수 있다”고 설명했다.

  • Prophet은 sklearn model API를 따름
  • 시계열과 수치로 작성된 데이터를 활용해 예측 값을 찾아낼 수 있다
  1. 이전의 주가 데이터를 넣고, 이후의 주가 데이터를 찾기
  2. 지금까지의 인구수를 넣고 미래의 인구수를 예측
  3. 우리나라의 연도별 도시 면적을 통해 앞으로의 도시 면적을 전망하는 등 여러 분양에 활용 가능

참조링크


필요 설치 Library

  • pystan
  • prophet
  • fbprophet

설치시도 하며 겪은 과정

  • 현재 내 python 버전 3.9.13

fbprophet 를 사용해보고자 인터넷에서 하라는 대로 다 해봤다
fbprophet 는 pystan 에 종속된 library 라서 pystan 을 무조건 설치를 해야만 한다
하지만 python 버전이 3.7 아래로만 가능해서 pystan 버전 자체를 낮춰서 다운받아야만 하는 점이 있다고 하기에 아래와 같이 설치 시도를 해 보았다

pip install pystan==2.19.1.1

결과는...

...

  building 'pystan._api' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

Encountered error while trying to install package.

pystan

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

그리고 아래와 같은 방법으로 하면 된다 해서 이 방법으로 시도해보았으나..

conda install -c conda-forge fbprophet

결과는 마찬가지로 아래 후에 10분이 넘어도 20분이 넘어도 넘어가지를 않다가

30분정도 기다리니까 아래와 같이 뜨며 마무리 되었다

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solv
Solving environment: ...working... failed with repodata from current_repodata.json, will retry w
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solv
Solving environment: ...working...

Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - fbprophet -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']

Your python: python=3.9

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

겨우 30분 기다려서 얻은 답변이라니...🤬🤬🤬🤬

Solution

Idea - Anaconda Navigator

아나콘다 네비게이션에서 손수 다운을 받으려 한다

Anaconda Navigator 를 들어가니 최신버전이 아니니 업데이트를 하라고 했다.

CLI 환경에서 계속 에러가 뜨길래

anaconda prompt 를 열어서 업데이트 하려고 했다

그러나 처음부터 난관....

...

RemoveError: 'setuptools' is a dependency of conda and cannot be removed from

 
conda's operating environment.

업데이트 부터 안되었다 그럼 강제업데이트를 하면 되징ㅎㅎ

  1. conda update --force conda
  2. conda update anaconda
  3. conda update conda

일단 업데이트는 완료..

(네비게이터 들어가면 업데이트 버튼 누르라는 팝업 또 뜨는데 누르면 정상작동된다)


그 이후로 Apply 누르는 화면이 한번 더 나오는데 눌러주면 된다.

감격...드디어 install 이 되었다....무려 3시간 끝에 해결했다...ㅠㅠㅠㅠㅠ

진짜로...setting 과 install 이 제일 어렵다...

fbprophet 설치

Anaconda Navigator 에서 터미널을 연다

위에서 시도해 보았던 명령어를 이제 다시 시도해본다

conda install -c conda-forge fbprophet

우우..열받는다...!!! 🤯🤯🤯🤯

이건 conda 가 최신버전 이 아닌 경우 이런 현상이 나오기도 한다고 한다...

  1. pip install --upgrade pip

  2. conda update -n base conda

  3. conda update --all

위와 같이 최신 업데이트로 받아 준 후에

conda install -c conda-forge fbprophet 를 다시 입력해주었다...

후.....안되는 군...😣😣

REFERENCE

profile
지혜는 지식에서 비롯된다

0개의 댓글