Reputation: 1
I'm a beginner to flask, following the installation instructions from the website. I'm using python 3.4 and I've run all the following code in my command prompt
$ mkdir myproject
$ cd myproject
$ virtualenv venv
python executable in venv/bin/python
Installing distribute............done.
$ . venv/bin/activate
$ venv\scripts\activate
$ pip install Flask
I'm pretty sure the virtualenv is activated since venv is before every line of code. But now I'd like to import flask, but when I start up python in my cmd it says no module named flask. What am I doing wrong?
Upvotes: 0
Views: 1783
Reputation: 44142
When you activate virtualenv, the activation is valid for current command line session.
If you open another console, it has completely independent status and initially does not know anything about any virtualenv.
It is perfectly fine, to have multiple consoles open an few of them sharing the same virtualenv.
Upvotes: 0
Reputation: 59671
Make sure the output of which python
is pointing to the python binary inside your venv
folder. Also make sure you are doing from flask import Flask
inside python.
Here's my commands that worked just now
$ virtualenv venv
$ cd venv
$ . bin/activate
(venv)$ pip install Flask
(venv)$ python
>>> from flask import Flask
Upvotes: 1