#Importing yfinance does not let me print anything

1 messages · Page 1 of 1 (latest)

knotty forge
#

I was working on a stock screener and I took a break and later my code wasn't printing anything anymore. I tried it out on a smaller scale.
Doing this:

import yfinance as yf

print(2)

Will not print anything, but getting rid of that import or using a different one instead will work. Anyone know what the issue is here?

pine schooner
#

Is it installed? (pip install yfinance)

#

If so, is it installed in the correct virtual environment

knotty forge
pine schooner
knotty forge
#

I think that it is just making it stop the program

pine schooner
#

I think your VS may not be using the same conda environment as the terminal you installed in

#

maybe try doing:

  1. conda env list
  2. find the environment for your project
  3. activate the environment (conda activate envname)
  4. conda list to see if package is installed
knotty forge
#

I only have one environemtn for python on my laptop

#

Ill still try

#

yeah I still have everything

#

conda base

#

if im not using any environemnt wouldn't that not let me run any code at all?

pine schooner
knotty forge
#

why would my other libraries work then, using pandas or datetime has no effect on it

pine schooner
knotty forge
#

maybe

#

i tried it on google colab and it seems to be working

#

but it is the same version of yfinance at least

#

didn't check python

pine schooner
#

maybe try installing a new package and importing it to confirm that yfinance is the problem?

#

Colorama is a small package u can try to install

knotty forge
#

3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (Colab version)
3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:29:11) [MSC v.1935 64 bit (AMD64)] (my version)

#

@pine schooner do i have to reinstall all my libraries if I redownload python?

pine schooner
#

with pip its pip freeze > requirements.txt

#

then pip install -r requirements.txt something like that

knotty forge
#

ill search up the conda equivalent using chatgpt