Thus, I came across a funny problem when trying to use Flask, I can only run it from ~ / (home), and not from ~ / Projects / projectfolder. I am using Python 2.7.4 installed through their homepage, virtualenv and virtualenvwrapper. Each time itβs the same thing:
$ mkvirtualenv project New python executable in project/bin/python Installing setuptools............done. Installing pip...............done.
Then I check the box:
$ pip install flask [...] Successfully installed flask Werkzeug Jinja2 Cleaning up...
Then I open Python from my home directory:
(project) $ python >>> from flask import Flask >>>
Then I leave and go to the project folder:
(project) $ cd ~/Projects/example (project) $ python >>> from flask import Flask Traceback (most recent call last): File "<stdin>", line 1, in <module> File "flask.py", line 1, in <module> from flask import Flask ImportError: cannot import name Flask
And I lost a little, why is this happening, does anyone have any ideas?
Sondre nilsen
source share