Flask debug not working under Anaconda

前端 未结 2 1169
谎友^
谎友^ 2021-01-13 23:28

I\'m working in a standard development environment with Flask and am having trouble getting the debug to work.

Just using the standard Hello World, with an error l

相关标签:
2条回答
  • 2021-01-13 23:52

    You can also uninstall the conda packages

    conda remove flask
    conda remove werkzeug
    

    Then just pip install both of those

    pip install flask
    pip install werkzeug
    

    That worked for me using conda 3.4.2

    0 讨论(0)
  • 2021-01-13 23:55

    The above comment by dirn Feb 24 at 3:35 is correct. However, with anaconda, uninstalling and reinstalling packages does not help. Here is a hack that got mine to work...

    The werkzeug/debug directory on my anaconda installation is missing a directory called shared. I have a non-anaconda installation of flask (using macports in my case). I simply copied that directory from my macports installation to the anaconda installation. The command for this with full path names that I used for my flasky conda virtual environment was:

    cp -r /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/werkzeug/debug/shared  ~/anaconda/envs/flasky/lib/python2.7/site-packages/werkzeug/debug 
    

    You need to do this separately for each conda virtual environment. Your path names may vary. Also, you should probably ensure that the non-anaconda installation is the same version of werkzeug.

    0 讨论(0)
提交回复
热议问题