Search code examples
windowspycharmauthlib

Run authlib example server from pycharm?


I just downloaded this project. Try to run it from command line, everything works. Try to run it from pycharm - I get this error:

c:\Users\Ignas\Anaconda3\envs\ugpsts\python.exe -m flask run Traceback (most recent call last): File "C:\Users\Ignas\Anaconda3\envs\ugpsts\lib\runpy.py", line 183, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "C:\Users\Ignas\Anaconda3\envs\ugpsts\lib\runpy.py", line 142, in _get_module_details return _get_module_details(pkg_main_name, error) File "C:\Users\Ignas\Anaconda3\envs\ugpsts\lib\runpy.py", line 109, in _get_module_details import(pkg_name) File "C:\Users\Ignas\Anaconda3\envs\ugpsts\lib\site-packages\flask__init__.py", line 21, in from .app import Flask, Request, Response File "C:\Users\Ignas\Anaconda3\envs\ugpsts\lib\site-packages\flask\app.py", line 25, in from . import cli, json File "C:\Users\Ignas\Anaconda3\envs\ugpsts\lib\site-packages\flask\cli.py", line 18, in import ssl File "C:\Users\Ignas\Anaconda3\envs\ugpsts\lib\ssl.py", line 98, in import _ssl # if we can't import it, let the error propagate ImportError: DLL load failed: The specified module could not be found. `

This error doesn't really tell much to me, what could be wrong? When I runt it from cmd, I use flask run command. So nothing really different.


Solution

  • That's a known issue in PyCharm with conda environments: PY-27234. For the workaround you can set the correct PATH in the Run Configuration environment variables. It can be obtained from the terminal outside of PyCharm with echo %PATH% after env activation.