1

I have installed virtualenv and I'm trying to create a new environment and the following error occurs.

tukey:env juanzinser$ virtualenv general
-bash: virtualenv: command not found

I'm not sure is a virtualenv problem since the same goes on trying to create a new django project.

tukey:env juanzinser$ django-admin startproject mysite
-bash: django-admin: command not found

Not sure if it's a permission issue (I have admin rights though), because both virtualenv and django are correctly installed.

tukey:env juanzinser$ pip install virtualenv
Requirement already satisfied (use --upgrade to upgrade): virtualenv in      /Library/Python/2.7/site-packages/virtualenv-13.1.2-py2.7.egg
Cleaning up...
tukey:env juanzinser$ pip install django
Requirement already satisfied (use --upgrade to upgrade): django in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Cleaning up...
ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152
jwzinserl
  • 427
  • 1
  • 3
  • 7
  • 2
    Check your path. Bash cannot find the executable. – user590028 Nov 20 '15 at 19:12
  • 2
    The directory containing `virtualenv` and `django-admin` are not in your `PATH` ..use full path instead or make an alias or include the directories in the `PATH` – heemayl Nov 20 '15 at 19:13
  • See also: [virtualenv, mysql-python, pip: anyone know how?](http://stackoverflow.com/q/1511661/55075) – kenorb Nov 20 '15 at 19:16

2 Answers2

0

Check for the location of the virtualenv by:

which virtualenv

and then try to run virtual environment with the complete path.Like when I do this, here is what I get.

$ which virtualenv
$ /usr/local/bin/virtualenv

then run it like

/usr/local/bin/virtualenv general
Rahul
  • 2,580
  • 1
  • 20
  • 24
-1

I have the same problem with you. but I figure out. You just use Fisrt: You need to find where the django-admin file, then use flexible connection command.

Example:

find / -name django-admin

/usr/local/python3.5.0/bin/django-admin

ln -s /usr/local/python3.5.0/bin/django-admin /usr/bin/

Walle Luo
  • 39
  • 4
  • I wouldn't recommend adding random things into `/usr/bin`. One should rather add `/usr/local/python3.5.0/bin` into `PATH` in their user environment scripts (e.g. `~/.bash_profile` or `~/.bashrc`). – ivan_pozdeev Oct 14 '17 at 09:25