yf.download(tickers = nasdaq_tickers, period = 'max', interval = '1d', group_by = 'ticker', threads=3)
[ 0% ] 10 of 4933 completed
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Input In [23], in <cell line: 1>()
----> 1 yf.download(tickers = nasdaq_tickers, period = 'max', interval = '1d', group_by = 'ticker', threads=3)
File ~/opt/anaconda3/lib/python3.8/site-packages/yfinance/multi.py:105, in download(tickers, start, end, actions, threads, group_by, auto_adjust, back_adjust, progress, period, show_errors, interval, prepost, proxy, rounding, timeout, **kwargs)
103 _multitasking.set_max_threads(threads)
104 for i, ticker in enumerate(tickers):
--> 105 _download_one_threaded(ticker, period=period, interval=interval,
106 start=start, end=end, prepost=prepost,
107 actions=actions, auto_adjust=auto_adjust,
108 back_adjust=back_adjust,
109 progress=(progress and i > 0), proxy=proxy,
110 rounding=rounding, timeout=timeout)
111 while len(shared._DFS) < len(tickers):
112 _time.sleep(0.01)
File ~/opt/anaconda3/lib/python3.8/site-packages/multitasking/__init__.py:119, in task.<locals>.async_method(*args, **kwargs)
116 single = config["POOLS"][config["POOL_NAME"]]['engine'](
117 target=_run_via_pool, args=args, kwargs=kwargs)
118 config["TASKS"].append(single)
--> 119 single.start()
120 return single
File ~/opt/anaconda3/lib/python3.8/threading.py:852, in Thread.start(self)
850 _limbo[self] = self
851 try:
--> 852 _start_new_thread(self._bootstrap, ())
853 except Exception:
854 with _active_limbo_lock:
RuntimeError: can't start new thread
nasdaq_stocks
[******************** 41% ] 2028 of 4933 completed
Выставил yf.download(tickers = nasdaq_tickers, period = 'max', interval = '1d', group_by = 'ticker', threads=0)
и помогло. Качает медленно. на всю базу потребовалось около получаса. Но вроде бы скачало. Теперь надо как-то рандомно проверить корректность скачанных данных, но это уже другая задача.
Спасибо вам.