{"id":1066,"date":"2022-12-28T11:50:12","date_gmt":"2022-12-28T11:50:12","guid":{"rendered":"https:\/\/thomas.w-p.me.uk\/blog\/?p=1066"},"modified":"2022-12-28T11:51:45","modified_gmt":"2022-12-28T11:51:45","slug":"yfinance-on-raspberry-pi-not-working","status":"publish","type":"post","link":"https:\/\/thomas.w-p.me.uk\/blog\/2022\/12\/yfinance-on-raspberry-pi-not-working\/","title":{"rendered":"yfinance 0.2.3 on raspberry pi"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I have a silly little script that checks the shares each day and sends me a telegram, but it stopped working. After an hour or so of analysis I determined that the version of yfinance on raspberry pi that I had, 1.74, was returning None on any call. If I upgrade to 2.3 on Windows (update pip,<em>pip install -upgrade pip<\/em>, then <em>pip install &#8211;upgrade yfinance<\/em>, it all starts working again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Getting it to work on Raspberry Pi was not so simple. This is a record of what I did.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Show the currently installed packages in the venv<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source .\/.venv\/bin\/activate\npip list<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Upgrade pip and try to upgrade yfinance<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install --upgrade pip\npip install --upgrade yfinance<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You get an error saying that rust is the wrong version. Doing <em>sudo apt install rustc<\/em> does not install a version of rust that is high enough. So <a href=\"https:\/\/www.rust-lang.org\/tools\/install\" target=\"_blank\" rel=\"noreferrer noopener\">you turn to rust istelf<\/a> and use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --proto '=https' --tlsv1.2 -sSf https:\/\/sh.rustup.rs | sh <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then follow the instructions. You need to kill the shell or read the message and<em> source &#8220;$HOME\/.cargo\/env&#8221;<\/em>. Then try to upgrade yfinance again.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install --upgrade yfinance<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It now fails with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>error: command '\/usr\/bin\/arm-linux-gnueabihf-gcc' failed with exit code 1\nnote: This error originates from a subprocess, and is likely not a problem with pip.\nERROR: Failed building wheel for cryptography\nFailed to build cryptography\nERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So try to get gcc working. I read that installing gcc libffi-dev libssl-dev and python3-dev might help so did that, though I already had gcc and python3-dev installed so just needed this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install libffi-dev libssl-dev\npip install --upgrade yfinance<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And THAT fixed it ?so I now have yfinance 0.2.3 and yfinance works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a silly little script that checks the shares each day and sends me a telegram, but it stopped working. After an hour or so of analysis I determined that the version of yfinance on raspberry pi that I had, 1.74, was returning None on any call. If I upgrade to 2.3 on Windows &hellip; <a href=\"https:\/\/thomas.w-p.me.uk\/blog\/2022\/12\/yfinance-on-raspberry-pi-not-working\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">yfinance 0.2.3 on raspberry pi<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,107],"tags":[],"class_list":["post-1066","post","type-post","status-publish","format-standard","hentry","category-python","category-yfinance"],"_links":{"self":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/1066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=1066"}],"version-history":[{"count":4,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/1066\/revisions"}],"predecessor-version":[{"id":1070,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/1066\/revisions\/1070"}],"wp:attachment":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=1066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=1066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=1066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}