Ошибка в Jupyter Notebook при открытии файла

Открываю файл в коде в Jupyter Notebook встроенной функцией:

try:
    f = open(cache_path, 'rb')
    df = pickle.load(f)

возвращает ошибку:

FileNotFoundError                         Traceback (most recent call last)
Cell In[5], line 5, in get_quandl_data(quandl_id)
      4 try:
----> 5     f = open(cache_path, 'rb')
      6     df = pickle.load(f)

File ~\anaconda3\envs\r41env\Lib\site-packages\IPython\core\interactiveshell.py:310, in _modified_open(file, *args, **kwargs)
    304     raise ValueError(
    305         f"IPython won't let you open fd={file} by default "
    306         "as it is likely to crash IPython. If you know what you are doing, "
    307         "you can use builtins' open."
    308     )
--> 310 return io_open(file, *args, **kwargs)

FileNotFoundError: [Errno 2] No such file or directory: 'BCHARTS-KRAKENUSD.pkl'

During handling of the above exception, another exception occurred:

LimitExceededError                        Traceback (most recent call last)
Cell In[7], line 1
----> 1 btc_usd_price_kraken = get_quandl_data('BCHARTS/KRAKENUSD')

Cell In[5], line 11, in get_quandl_data(quandl_id)
      8 except (OSError, IOError) as err:
      9     print(f'Currently downloading {cache_path} from Quandl')
---> 11     df = quandl.get(quandl_id, returns='pandas')
     12     df.to_pickle(cache_path)
     14     print(f'Cached {quandle_id} at {cache_path}')

File ~\anaconda3\envs\r41env\Lib\site-packages\quandl\get.py:48, in get(dataset, **kwargs)
     46     if dataset_args['column_index'] is not None:
     47         kwargs.update({'column_index': dataset_args['column_index']})
---> 48     data = Dataset(dataset_args['code']).data(params=kwargs, handle_column_not_found=True)
     49 # Array
     50 elif isinstance(dataset, list):

File ~\anaconda3\envs\r41env\Lib\site-packages\quandl\model\dataset.py:47, in Dataset.data(self, **options)
     45 updated_options = Util.merge_options('params', params, **options)
     46 try:
---> 47     return Data.all(**updated_options)
     48 except NotFoundError:
     49     if handle_not_found_error:

File ~\anaconda3\envs\r41env\Lib\site-packages\quandl\operations\list.py:15, in ListOperation.all(cls, **options)
     13     options['params'] = {}
     14 path = Util.constructed_path(cls.list_path(), options['params'])
---> 15 r = Connection.request('get', path, **options)
     16 response_data = r.json()
     17 Util.convert_to_dates(response_data)

File ~\anaconda3\envs\r41env\Lib\site-packages\quandl\connection.py:38, in Connection.request(cls, http_verb, url, **options)
     34 options['headers'] = headers
     36 abs_url = '%s/%s' % (ApiConfig.api_base, url)
---> 38 return cls.execute_request(http_verb, abs_url, **options)

File ~\anaconda3\envs\r41env\Lib\site-packages\quandl\connection.py:50, in Connection.execute_request(cls, http_verb, url, **options)
     45 response = session.request(method=http_verb,
     46                            url=url,
     47                            verify=ApiConfig.verify_ssl,
     48                            **options)
     49 if response.status_code < 200 or response.status_code >= 300:
---> 50     cls.handle_api_error(response)
     51 else:
     52     return response

File ~\anaconda3\envs\r41env\Lib\site-packages\quandl\connection.py:114, in Connection.handle_api_error(cls, resp)
    103 d_klass = {
    104     'L': LimitExceededError,
    105     'M': InternalServerError,
   (...)
    110     'X': ServiceUnavailableError
    111 }
    112 klass = d_klass.get(code_letter, QuandlError)
--> 114 raise klass(message, resp.status_code, resp.text, resp.headers, code)

LimitExceededError: (Status 429) (Quandl Error QELx04) You have exceeded the API speed limit of 20 calls per 10 minutes. Please slow down your requests.

что делать?


Ответы (0 шт):