Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come I can not activate my Virtual Python Environment with 'source env/bin/activate' command?

Tags:

python

pylons

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?


2 Answers

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 :)

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.

like image 23
9000 Avatar answered Sep 08 '25 12:09

9000