
【Python】Anaconda環境でyfinanceをDLするのに苦戦した話
こんにちは!!!
興味本位で自分が持っている投資信託の分析を(anaconda環境)pythonのyfinance使ってやろうと思いました。まさかの環境構築の時点で苦戦・・・
①まぁーconda installじゃ上手くいかない
Anacondaのページ見ると「conda install -c conda-forge yfinanceを利用してください」とのことです。
が、案の定上手くいきませんでした。
solving enviroment がfailedしました。リトライしているみたいですが10分以上待っても進みません。

②そもそもconda install じゃ上手くいかない説
同じような悩みを持っている人がいないか、Githubで確認してみました。
下の方にいくと、
「. What I could do to install yfinance is using pip only at this moment.」
とのこと
・・・(;^ω^)
yfinanceはpipでインストールするのが無難かもしれません。
③anaconda環境でpip 利用するために
下記を参照しました
上記でやってみたのですが、
「ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.conda-repo-cli 1.0.4 requires pathlib, which is not installed.」
とエラー出ました。conda-repo-cli 1.0.4がpipじゃインストールできないと予想。
「conda install -c anaconda conda-repo-cli」とターミナルに入力しました。
再度、「pip install yfinance」とターミナルに入力しました。

無事完了です。