pallets / flask

The Python micro framework for building web applications.
https://flask.palletsprojects.com
BSD 3-Clause "New" or "Revised" License
67.18k stars 16.08k forks source link

Python 3.8.x - Error on flask import #3596

Closed strunker closed 4 years ago

strunker commented 4 years ago

import flask or from flask import Flask

both generate the below. Not sure what to make of this also seems to be an issue on 3.8.2 i tried two different machines both end in the same result.

Traceback (most recent call last):
  File "C:\Users\user\Desktop\AlexaSkill\testingflask.py", line 1, in <module>
    import flask
  File "C:\Python38\lib\site-packages\flask\__init__.py", line 16, in <module>
    from werkzeug.exceptions import abort
  File "C:\Python38\lib\site-packages\werkzeug\__init__.py", line 15, in <module>
    from .serving import run_simple
  File "C:\Python38\lib\site-packages\werkzeug\serving.py", line 58, in <module>
    from http.server import BaseHTTPRequestHandler
  File "C:\Python38\lib\http\server.py", line 94, in <module>
    import http.client
  File "C:\Python38\lib\http\client.py", line 1352, in <module>
    import ssl
  File "C:\Users\user\Desktop\AlexaSkill\ssl.py", line 16, in <module>
    asyncio.get_event_loop().run_until_complete(hello())
  File "C:\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\Users\user\Desktop\AlexaSkill\ssl.py", line 7, in hello
    async with websockets.connect(uri) as websocket:
  File "C:\Python38\lib\site-packages\websockets\client.py", line 517, in __aenter__
    return await self
  File "C:\Python38\lib\site-packages\websockets\client.py", line 535, in __await_impl__
    transport, protocol = await self._create_connection()
  File "C:\Python38\lib\asyncio\base_events.py", line 1030, in create_connection
    raise exceptions[0]
  File "C:\Python38\lib\asyncio\base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
  File "C:\Python38\lib\asyncio\base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
  File "C:\Python38\lib\asyncio\proactor_events.py", line 702, in sock_connect
    return await self._proactor.connect(sock, address)
  File "C:\Python38\lib\asyncio\windows_events.py", line 808, in _poll
    value = callback(transferred, key, ov)
  File "C:\Python38\lib\asyncio\windows_events.py", line 595, in finish_connect
    ov.getresult()

ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection
[Finished in 4.7s]
ThiefMaster commented 4 years ago

Your environment (e.g. the PYTHONPATH env var) looks broken. See that ssl import coming from your desktop? I'm pretty sure that this should not happen for a stdlib import.

strunker commented 4 years ago

Your environment (e.g. the PYTHONPATH env var) looks broken. See that ssl import coming from your desktop? I'm pretty sure that this should not happen for a stdlib import.

THANK YOUU dumb me. I saved a test file named ssl in the same dir the script is running from so it was trying to import that and breaking literally everything.. DURP!