greyli / helloflask

Hello, Flask!
https://docs.helloflask.com
MIT License
1.87k stars 2.53k forks source link

运行环境报错 #211

Closed WinterPrince closed 4 years ago

WinterPrince commented 4 years ago

李哥你好!我是一名初学者,在windows下用的anaconda创建的虚拟环境flask,然后使用flask run运行时报错,网上搜索时没找到好的解决办法==,恳请李哥指点! 具体报错信息如下:

Traceback (most recent call last):
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask\app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask\app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask\app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask\app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask\app.py", line 1953, in full_dispatch_request
    return self.finalize_request(rv)
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask\app.py", line 1970, in finalize_request
    response = self.process_response(response)
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask\app.py", line 2267, in process_response
    response = handler(response)
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask_debugtoolbar\__init__.py", line 222, in process_response
    toolbar_html = toolbar.render_toolbar()
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask_debugtoolbar\toolbar.py", line 46, in render_toolbar
    return template.render(**context)
  File "G:\Anaconda3\envs\flask\lib\site-packages\jinja2\environment.py", line 1090, in render
    self.environment.handle_exception()
  File "G:\Anaconda3\envs\flask\lib\site-packages\jinja2\environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "G:\Anaconda3\envs\flask\lib\site-packages\jinja2\_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask_debugtoolbar\templates\base.html", line 50, in top-level template code
    {{ panel.content()|safe }}
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask_debugtoolbar\panels\versions.py", line 51, in content
    'relpath': relpath,
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask_debugtoolbar\panels\__init__.py", line 30, in render
    return template.render(**context)
  File "G:\Anaconda3\envs\flask\lib\site-packages\jinja2\environment.py", line 1090, in render
    self.environment.handle_exception()
  File "G:\Anaconda3\envs\flask\lib\site-packages\jinja2\environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "G:\Anaconda3\envs\flask\lib\site-packages\jinja2\_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask_debugtoolbar\templates\panels\versions.html", line 23, in top-level template code
    <td>{{ relpath(package.location, python_lib) }}</td>
  File "G:\Anaconda3\envs\flask\lib\site-packages\flask_debugtoolbar\panels\versions.py", line 12, in relpath
    relative = os.path.relpath(location, python_lib)
  File "G:\Anaconda3\envs\flask\lib\ntpath.py", line 584, in relpath
    path_drive, start_drive))
ValueError: path is on mount 'c:', start on mount 'G:'
greyli commented 4 years ago

你好,麻烦提供相关代码。另外建议尝试搜索关键词「ValueError: path is on mount 'c:', start on mount 'G:'」解决,看到不少相关的网页。

greyli commented 4 years ago

缺乏足够的信息,先关闭了,如果没解决欢迎重开或继续评论。