Module not found error for yfinance

import yfinance as yf
import pandas as pd

Define the list of stock and commodity ticker symbols

ticks=[“ADI”]

Download historical data for the given symbols using yfinance

data = yf.download(ticks,interval=“1mo”, rounding=True)
this my code if i executed in python script node then showing error module not found.
i am trying solve this issue but still not getting any solution. anyone is who can help me ?

The issue you are having is that you are referencing Python libraries, but Knime does not know where they are. You will have to use Conda to install them into the Python environment you are using.

I recommend reading this documentation.

KNIME Python Integration Guide

3 Likes

@XiozTzu as per your python Integration Guide i did follow all process like open anaconda command promopt then create env and then inside this env installed resquired liabrary then deactivate env then go into knime then preferences then open python option then selct conda paste path where i installed liabrary . but its show me some massage still not working . you can see in image.

@Rohit_208 maybe you want to take a look at this article:

2 Likes

@mlauber @XiozTzu thank you so much right activate my conda env but after execute code still showing error.

@Rohit_208 you will have to make sure your Python node actually uses your conda environment, maybe try a restart of KNIME.

image

You would either use the environment from the general conda settings (where you will have to make sure you have your Python packages) or you might want to choose an individual setting.

2 Likes

@mlauber71 if i select conda env option from python script node then if i take back then again it’s going to python env.please find attached some pic.



i did setting in this way but not working.

@Rohit_208 two things. You could provide us with a fresh logfile in debug mode.

Then you can try the yml file from the example I provided above.

2 Likes

@mlauber71 sorry for late reply actually i have sensitive info then its good thing to send logfile.

@mlauber71 i got the solution , please close this topic. thanks

@Rohit_208 maybe you can share what it was. And if it is in one of the posts you could mark that as a solution.

KNIME Python Integration Guide i prepared this document for this problem.