1

I just started learning Flask (and as a result, getting into virtualenv as well). I followed a tutorial on Flask's documentation and created a small application. I installed Flask and yolk using venv and everything was working fine.

I restarted my computer and when I activated virtualenv again, flask and yolk were no longer recognised. I had to reinstall them via easy_install. Does venv remove any installed packages once the computer has been restarted?

What happened here? Is there anything I need to do from my side?

darksky
  • 20,411
  • 61
  • 165
  • 254

1 Answers1

2

As long as you're sourcing the virtualenv correctly and installing the packages correctly, your virtualenv should not be affected by a reboot. It's completely independent of that. There are one of three possibilities that I can think of that explains your issues:

  1. The incorrect virtualenv was sourced
  2. You installed flask and yolk onto the system python
  3. You used some kind of ephemeral storage

(The third is the least likely)

ravenac95
  • 3,557
  • 1
  • 20
  • 21
  • If I installed flask and yolk onto the system python, then running `which yolk` and `which flask` would yield the path to the file in `bin`. I got nothing as a result. I only have one virtualenv installed so that also takes point #1 out? – darksky Aug 27 '12 at 00:28
  • Did you make sure to source that virtualenv? – ravenac95 Aug 27 '12 at 00:36
  • I realised I had yolk and flask installed onto the system python. The reason being is I ran `pip` with `sudo` because I am getting a `error: could not create '/Library/Python/2.7/site-packages/flask': Permission denied` once I run `pip install flask` when virtualenv is activated. How can I overcome this? – darksky Aug 27 '12 at 14:12
  • 1
    My suggestion would be to remove your virtualenv. So if you're on unix or linux just ``rm -rf path_to_your_virtualenv``. Rebuild the virtualenv (do not use sudo) and then it should work. – ravenac95 Aug 27 '12 at 17:29