月舞空辰
2022-05-06 20:09
采纳率: 50%
浏览 17

python CoinGeckoAPI连接不上

代码如下:

python
from pycoingecko import CoinGeckoAPI

cg = CoinGeckoAPI()

id = 'binancecoin'

a = cg.get_coin_by_id(id)
print(a)

Traceback (most recent call last):
  File "C:\Users\XS\Desktop\bsc\Pancakeswap-and-uniswap-trading-bot-master\source_files\T2.py", line 10, in <module>
    a = cg.get_coin_by_id(id)
  File "C:\Users\XS\anaconda3\lib\site-packages\pycoingecko\utils.py", line 12, in input_args
    return func(*args, **kwargs)
  File "C:\Users\XS\anaconda3\lib\site-packages\pycoingecko\api.py", line 140, in get_coin_by_id
    return self.__request(api_url)
  File "C:\Users\XS\anaconda3\lib\site-packages\pycoingecko\api.py", line 24, in __request
    response = self.session.get(url, timeout=self.request_timeout)
  File "C:\Users\XS\anaconda3\lib\site-packages\requests\sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "C:\Users\XS\anaconda3\lib\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\XS\anaconda3\lib\site-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\XS\anaconda3\lib\site-packages\requests\adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.coingecko.com', port=443): Max retries exceeded with url: /api/v3/coins/binancecoin/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))



怎么能解决那个SSLError

1条回答 默认 最新

相关推荐 更多相似问题