I use forex python CurrencyRates in many of my project, but now it doesn't work, none of them. Is there any problem with my code or are the server down? or what happend?
Here is my Code:
from forex_python.converter import CurrencyRates
c = CurrencyRates()
usd = c.get_rate('EUR', 'USD')
And the error:
Traceback (most recent call last):
File "D:\MeineDaten\Programmieren\Python\Projekte\Flask\ProjectX\main.py", line 2, in <module>
from files.currency import currency
File "D:\MeineDaten\Programmieren\Python\Projekte\Flask\ProjectX\files\currency.py", line 7, in <module>
usd = c.get_rate('EUR', 'USD')
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\forex_python\converter.py", line 66, in get_rate
response = requests.get(source_url, params=payload)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.ratesapi.io', port=443): Max retries exceeded with url: /api/latest?base=EUR&symbols=USD&rtype=fpy (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001F0C1D056A0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))