Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can't install yfinance
#1
Photo 
Hi , I'm trying to get involved with a product that uses python. I tried everything imaginable as shown below in the command prompt images after downloading python and what i think is the installer. And cannot get yFinance to install. I wasn't sure what difference inserting the images into the post made but I did it anyway.

       
Reply
#2
i poked around a bit and noticed there was an app called pip not in but in subfolder lib but rather subfolder scripts. So I cd'd there and typed pip install yfinance. and beside some warnings saw lots of things finally happening and believe i have installed yfinance. I dont see how to attach an image in a reply so i am pasting the response below.

Microsoft Windows [Version 10.0.22621.1702]
© Microsoft Corporation. All rights reserved.

C:\Users\stant>cd AppData\Local\Programs\Python\Python311\scripts

C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts>pip install yfinance
Collecting yfinance
Downloading yfinance-0.2.20-py2.py3-none-any.whl (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.5/62.5 kB 1.6 MB/s eta 0:00:00
Collecting pandas>=1.3.0 (from yfinance)
Downloading pandas-2.0.2-cp311-cp311-win_amd64.whl (10.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.6/10.6 MB 36.4 MB/s eta 0:00:00
Collecting numpy>=1.16.5 (from yfinance)
Downloading numpy-1.24.3-cp311-cp311-win_amd64.whl (14.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.8/14.8 MB 36.3 MB/s eta 0:00:00
Collecting requests>=2.26 (from yfinance)
Downloading requests-2.31.0-py3-none-any.whl (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB ? eta 0:00:00
Collecting multitasking>=0.0.7 (from yfinance)
Downloading multitasking-0.0.11-py3-none-any.whl (8.5 kB)
Collecting lxml>=4.9.1 (from yfinance)
Downloading lxml-4.9.2-cp311-cp311-win_amd64.whl (3.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 34.1 MB/s eta 0:00:00
Collecting appdirs>=1.4.4 (from yfinance)
Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting pytz>=2022.5 (from yfinance)
Downloading pytz-2023.3-py2.py3-none-any.whl (502 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 502.3/502.3 kB 30.8 MB/s eta 0:00:00
Collecting frozendict>=2.3.4 (from yfinance)
Downloading frozendict-2.3.8-py311-none-any.whl (14 kB)
Collecting cryptography>=3.3.2 (from yfinance)
Downloading cryptography-41.0.1-cp37-abi3-win_amd64.whl (2.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.6/2.6 MB 42.4 MB/s eta 0:00:00
Collecting beautifulsoup4>=4.11.1 (from yfinance)
Downloading beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.0/143.0 kB ? eta 0:00:00
Collecting html5lib>=1.1 (from yfinance)
Downloading html5lib-1.1-py2.py3-none-any.whl (112 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 112.2/112.2 kB ? eta 0:00:00
Collecting soupsieve>1.2 (from beautifulsoup4>=4.11.1->yfinance)
Downloading soupsieve-2.4.1-py3-none-any.whl (36 kB)
Collecting cffi>=1.12 (from cryptography>=3.3.2->yfinance)
Downloading cffi-1.15.1-cp311-cp311-win_amd64.whl (179 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179.0/179.0 kB ? eta 0:00:00
Collecting six>=1.9 (from html5lib>=1.1->yfinance)
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting webencodings (from html5lib>=1.1->yfinance)
Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting python-dateutil>=2.8.2 (from pandas>=1.3.0->yfinance)
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 14.8 MB/s eta 0:00:00
Collecting tzdata>=2022.1 (from pandas>=1.3.0->yfinance)
Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 341.8/341.8 kB 20.7 MB/s eta 0:00:00
Collecting charset-normalizer<4,>=2 (from requests>=2.26->yfinance)
Downloading charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl (96 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.7/96.7 kB 5.4 MB/s eta 0:00:00
Collecting idna<4,>=2.5 (from requests>=2.26->yfinance)
Downloading idna-3.4-py3-none-any.whl (61 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 3.4 MB/s eta 0:00:00
Collecting urllib3<3,>=1.21.1 (from requests>=2.26->yfinance)
Downloading urllib3-2.0.3-py3-none-any.whl (123 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 123.6/123.6 kB ? eta 0:00:00
Collecting certifi>=2017.4.17 (from requests>=2.26->yfinance)
Downloading certifi-2023.5.7-py3-none-any.whl (156 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 157.0/157.0 kB ? eta 0:00:00
Collecting pycparser (from cffi>=1.12->cryptography>=3.3.2->yfinance)
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB ? eta 0:00:00
Installing collected packages: webencodings, pytz, multitasking, appdirs, urllib3, tzdata, soupsieve, six, pycparser, numpy, lxml, idna, frozendict, charset-normalizer, certifi, requests, python-dateutil, html5lib, cffi, beautifulsoup4, pandas, cryptography, yfinance
WARNING: The script f2py.exe is installed in 'C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script normalizer.exe is installed in 'C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script sample.exe is installed in 'C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed appdirs-1.4.4 beautifulsoup4-4.12.2 certifi-2023.5.7 cffi-1.15.1 charset-normalizer-3.1.0 cryptography-41.0.1 frozendict-2.3.8 html5lib-1.1 idna-3.4 lxml-4.9.2 multitasking-0.0.11 numpy-1.24.3 pandas-2.0.2 pycparser-2.21 python-dateutil-2.8.2 pytz-2023.3 requests-2.31.0 six-1.16.0 soupsieve-2.4.1 tzdata-2023.3 urllib3-2.0.3 webencodings-0.5.1 yfinance-0.2.20

C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts>^A
Reply
#3
another module called matplotlib was also missing when i went to create / use a python connector but i was able to install it as well as shown below

C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts>pip install matplotlib
Collecting matplotlib
Downloading matplotlib-3.7.1-cp311-cp311-win_amd64.whl (7.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.6/7.6 MB 25.6 MB/s eta 0:00:00
Collecting contourpy>=1.0.1 (from matplotlib)
Downloading contourpy-1.0.7-cp311-cp311-win_amd64.whl (162 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.0/163.0 kB ? eta 0:00:00
Collecting cycler>=0.10 (from matplotlib)
Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting fonttools>=4.22.0 (from matplotlib)
Downloading fonttools-4.39.4-py3-none-any.whl (1.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 31.3 MB/s eta 0:00:00
Collecting kiwisolver>=1.0.1 (from matplotlib)
Downloading kiwisolver-1.4.4-cp311-cp311-win_amd64.whl (55 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.4/55.4 kB 3.0 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.20 in c:\users\stant\appdata\local\programs\python\python311\lib\site-packages (from matplotlib) (1.24.3)
Collecting packaging>=20.0 (from matplotlib)
Downloading packaging-23.1-py3-none-any.whl (48 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB ? eta 0:00:00
Collecting pillow>=6.2.0 (from matplotlib)
Downloading Pillow-9.5.0-cp311-cp311-win_amd64.whl (2.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 40.3 MB/s eta 0:00:00
Collecting pyparsing>=2.3.1 (from matplotlib)
Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 kB 5.5 MB/s eta 0:00:00
Requirement already satisfied: python-dateutil>=2.7 in c:\users\stant\appdata\local\programs\python\python311\lib\site-packages (from matplotlib) (2.8.2)
Requirement already satisfied: six>=1.5 in c:\users\stant\appdata\local\programs\python\python311\lib\site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)
Installing collected packages: pyparsing, pillow, packaging, kiwisolver, fonttools, cycler, contourpy, matplotlib
WARNING: The scripts fonttools.exe, pyftmerge.exe, pyftsubset.exe and ttx.exe are installed in 'C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed contourpy-1.0.7 cycler-0.11.0 fonttools-4.39.4 kiwisolver-1.4.4 matplotlib-3.7.1 packaging-23.1 pillow-9.5.0 pyparsing-3.0.9

C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts>
Reply
#4
You most add Script folder to Os Path,then pip will work from anywhere in cmd
Here how to edit add to path Environment Variables Path
Same as image but point to where you have installed Python 3.11.
C:\Users\stant\AppData\Local\Programs\Python\Python311\
C:\Users\stant\AppData\Local\Programs\Python\Python311\Scripts\
[Image: WfreEG.png]

Here quick demo on how to use virtual environment(venv comes with Python),
this can be smart to use if have a package that install a lot of 3 party depedesis.
This can avoid conflicts if you have installed a lot to OS Python version before.
# Check that python and pip work before start
G:\div_code>python -V
Python 3.11.3

G:\div_code>pip -V
pip 23.1.2 from C:\python311\Lib\site-packages\pip (python 3.11)

# Make environment 
G:\div_code>python -m venv new_env

# Cd in
G:\div_code>cd new_env

# Activate
G:\div_code\new_env>G:\div_code\new_env\Scripts\activate.bat

# See now that pip will point to new_env folder
(new_env) G:\div_code\new_env>pip -V
pip 22.3.1 from G:\div_code\new_env\Lib\site-packages\pip (python 3.11)

# Install, no is it like new Python version that has nothing installed
(new_env) G:\div_code\new_env>pip install requests
Collecting requests
  Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl (96 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting urllib3<3,>=1.21.1
  Downloading urllib3-2.0.3-py3-none-any.whl (123 kB)
     -------------------------------------- 123.6/123.6 kB 2.4 MB/s eta 0:00:00
Collecting certifi>=2017.4.17  
Successfully installed certifi-2023.5.7 charset-normalizer-3.1.0 idna-3.4 reques
ts-2.31.0 urllib3-2.0.3

(new_env) G:\div_code\new_env>
db042190 likes this post
Reply
#5
I wanted to but i dont see how to mark posts like snippsat's as an answer . But i marked it as a "like".
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  why is yfinance returning an ellipsis in the middle of ticket history db042190 3 978 Jun-12-2023, 06:03 PM
Last Post: db042190
  Yfinance - Intraday stock data with yf.download diogo_80 2 6,004 Apr-29-2022, 05:07 AM
Last Post: processingclouds

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020