Что делать если код не работает на pythonanywhere?

На компьютере код выполняется без каких либо ошибок, но я перенёс код на pythonanywhere, установил все нужные библиотеки и код выдаёт ошибку:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 696, in urlopen
    self._prepare_proxy(conn)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 964, in _prepare_proxy
    conn.connect()
  File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 366, in connect
    self._tunnel()
  File "/usr/local/lib/python3.9/http/client.py", line 903, in _tunnel
    raise OSError(f"Tunnel connection failed: {code} {message.strip()}")
OSError: Tunnel connection failed: 403 Forbidden
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 573, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='invest.divweb.ru', port=443): Max retries exceeded with url: /api/transactions/?vk_access_token_settings=&vk_app_id=7689931&vk_are_notifications_enabled=0&vk_is_app_user=1&vk_is_favorite=0&vk_language=ru&vk_platform=mobile_web&vk_ref=other&vk_ts=1645204600&vk_user_id=52868978&sign=7qaU33YYhsm92YFUIWLFM38J7AS-w8oDS1oxcxGd0A (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xDares/bot.py", line 107, in <module>
    response = requests.get(usrl)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 510, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='invest.divweb.ru', port=443): Max retries exceeded with url: /api/transactions/?vk_access_token_settings=&vk_app_id=7689931&vk_are_notifications_enabled=0&vk_is_app_user=1&vk_is_favorite=0&vk_language=ru&vk_platform=mobile_web&vk_ref=other&vk_ts=1645204600&vk_user_id=52868978&sign=7qaU33YYhsm92YFUIW6LFM38JAS-w8oDS1oxcxGd0A (Caused by ProxyError('Cannot connect to 
proxy.', OSError('Tunnel connection failed: 403 Forbidden')))
  • Вопрос задан
  • 296 просмотров
Пригласить эксперта
Ответы на вопрос 1
sergey-gornostaev
@sergey-gornostaev Куратор тега Python
Седой и строгий
Читать документацию Pythonanywhere, там описана ваша проблема. Да и на этом ресурсе вопрос уже задавался не раз.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы