Forums

Beginner needs help with Virtualenv

I don't understand how to setup virtualenvs. I tried following these instructions: https://www.pythonanywhere.com/wiki/Virtualenvs but they don't make any sense. I'm very new.

I just want to do a Flask tutorial online, but PythonAnywhere is setup so differently from all the online tutorials.

When I create a new web app should I select Flask or Manual Configuration?

I typed mkvirtualenv myvirtualenv --python=/usr/bin/python3.4 but I don't really know what that does? Where is my virtualenv? Do i have to link it to my web app? How? How do I activate it? This is all so confusing...

These are the tutorials I have been trying to follow:

  • http://simononsoftware.com/virtualenv-tutorial/
  • http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
  • http://flask.pocoo.org/docs/0.10/tutorial/introduction/

Whether you choose manual configuration of flask is not related to whether you use a virtualenv. You can create and activate a virtualenv for a webapp from the web app page without needing to use manual configuration. So, if you want a Flask app, choose Flask.

mkvirtualenv creates a virtualenv and puts it in /home/tliss/.virtualenvs. If you want to use it for your web app, there's a section on the web app config page to do that. If you want to activate it in a Bash console (so you can install things into it), use workon myvirtualenv