Search code examples
pythonvirtualenvflaskwerkzeug

Virtualenv issue with flask-werkzeug


I have installed virtualenv along with flask, werkzeug, jinja2 and SQLAlchemy. I was following the tutorial mentioned on the flask website and i came across the below error when executing flask code

 Traceback (most recent call last):
  File "hello.py", line 1, in ?
    from flask import Flask
  File "/root/myproject/env/lib/python2.4/site-packages/Flask-0.7dev_20110211-py2.4.egg/flask/__init__.py", line 18
    from .app import Flask, Request, Response
         ^

What i feel is that virtualenv contains python 2.4 and in the documentation of flask it is mentioned that flask supports python 2.5. So maybe that might be the problem or it might be someother issue. Please help me out on this.

Secondly i would like to know the process of getting the latest virtualenv which has Python 2.7 or any tips on how to install it on virtualenv.

I am using CentOS

Thank You in Advance


Solution

  • dunno what you did and how old your virtualenv is .. but you make your own virtualenv by:

    % python -c "import urllib, os; os.mkdir('py-env'); \
         urllib.urlretrieve('http://goo.gl/D2RB', 'py-env/virtualenv.py')"
    % python py-env/virtualenv.py --no-site-packages py-env
    % source py-env/bin/activate
    % pip install flask SQLAlchemy 
    

    that should work. virtualenv itself does not 'contain python'. do you run the correct version of python (dunno whats installed on your distro)?