tags:

views:

50

answers:

3

I am trying to activate my Virtual Python Environment to use with Pylons but I think I am executing the commands wrong.

jem@jem-laptop:~$ source env/bin/activate
bash: env/bin/activate: No such file or directory

What am I doing wrong? How should I do it right?

+1  A: 

I realize I had to do

jem@jem-laptop:~$ ls
Desktop    examples.desktop  Public           shortener.rb
Documents  Mac4Lin_v1.0      ruby-1.9.1-p378  Templates
Downloads  Music             rubygems-1.3.7   Videos
Dropbox    Pictures          setcolors.vim    virtualenv.py

And here we see virtualenv.py. From here I just had to

jem@jem-laptop:~$ virtualenv ENV
New python executable in ENV/bin/python
Installing setuptools............done.

And then

jem@jem-laptop:~$ source ENV/bin/activate
(ENV)jem@jem-laptop:~$ deactivate
jem@jem-laptop:~$ 

Solved :)

J3M 7OR3
A: 

I usually do it this way:

$ cd the_project_dir
$ . bin/activate
(the_project)$ _

I need to be in the project directory anyway to go on with the work. Obviously the_project_dir is the name of a directory where you have created a virtualenv.

9000
+1  A: 

I would recommend using virtualenvwrapper. It makes working with virtualenv a lot simpler, especially if you have more than one virtualenv.

Ben