没有模块使用virtualenv命名为flask [英] No module named flask using virtualenv

查看:137
本文介绍了没有模块使用virtualenv命名为flask的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照这些步骤学习烧瓶 http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world/page/0#comments



我运行这个命令来创建虚拟env:

pre $ py $ virtualenv.py flask

当我尝试在我的项目脚本目录中使用python.exe文件启动flask时,它说

 没有名为flask的模块

我的PATH设置为virtualenv安装的python目录。为什么不能找到烧瓶?

我最初是使用官方Flask quickstart指南开始的,能够让webserver运行,但是使用这个虚拟env安装却无法运行。

解决方案

确保你的virtualenv被激活。然后你检查那个virtualenv的 PYTHONPATH 。是否在该目录中安装了一个烧录包(文件夹)。



如果您不确定是否安装了烧瓶,只需运行以下命令即可查看已安装的所有软件包 pip list pip show flask 。你在那里看到烧瓶吗?如果没有,你可以运行 pip install flask


I am following these steps to learn flask http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world/page/0#comments

I ran this command to create the virtual env:

python virtualenv.py flask

When I try to start flask using the python.exe file in my project scripts directory, it says

No module named flask

My PATH is set to the python directory that virtualenv installed. Why is it not able to find flask?

I initially started with the official Flask quickstart guide and was able to get the webserver to run, but with this virtual env install it is not working.

解决方案

Make sure your virtualenv is activated. Then You check on the PYTHONPATH of that virtualenv. Is there a flask package (folder) installed in that directory.

If you unsure whether you have installed flask, just run the following command to see all the packages you have installed pip list or pip show flask. Do you see flask there? If not you can run pip install flask

这篇关于没有模块使用virtualenv命名为flask的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆