0

I'm new to programming and I'm trying to setup Django with python, PostgreSQL and virtualenv. My problem is (at this point) installing Django in my virtualenv. This i what I've done:

virtualenv --no-site-packages my-env

I took help from this video: https://www.youtube.com/watch?v=oT1A1KKf0SI. Now here is the first difference: I don't have a bin-folder. However, I have a Scripts-folder but I hope that's fine(?). After this I wrote this:

source my-env/Scripts/activate

Which worked fine. Then i typed:

easy_install Django

And Django was installed successfully (it said). Well, here is the problem. In the video it says that I should have a django-admin.py-file in the bin-directory. However, I've searched through ALL direcrories (Include, Lib, Scripts) and it doesn't exist. And without it I can't create any projects, right?

So what have I done wrong here? :S

EDIT: this is the code from my cygwin64 terminal.

Nina@Ninas-Zenbook ~
$ cd /cygdrive/c/users/nina/documents/virtualenvs

Nina@Ninas-Zenbook /cygdrive/c/users/nina/documents/virtualenvs
$ virtualenv --no-site-packages nina-django3
Using base prefix 'C:\\Python33'
New python executable in nina-django3\Scripts\python.exe
Installing setuptools, pip...done.

Nina@Ninas-Zenbook /cygdrive/c/users/nina/documents/virtualenvs
$ ls
nina-django3

Nina@Ninas-Zenbook /cygdrive/c/users/nina/documents/virtualenvs
$ cd nina-django3

Nina@Ninas-Zenbook /cygdrive/c/users/nina/documents/virtualenvs/nina-django3
$ source bin/activate
-bash: bin/activate: No such file or directory

Nina@Ninas-Zenbook /cygdrive/c/users/nina/documents/virtualenvs/nina-django3
$ source scripts/activate

(nina-django3)
Nina@Ninas-Zenbook /cygdrive/c/users/nina/documents/virtualenvs/nina-django3
$ pip install django
Requirement already satisfied (use --upgrade to upgrade): django in c:\python33\lib\site-packages
Cleaning up...

(nina-django3)
Nina@Ninas-Zenbook /cygdrive/c/users/nina/documents/virtualenvs/nina-django3
$ which django-admin.py
/cygdrive/c/Python33/Scripts/django-admin.py
Myone
  • 1,103
  • 2
  • 11
  • 24

1 Answers1

0

I am not at a location where I can stream the video, but you should have SOME folder, let's call it '/venvs/' (for: virtual environments) in which you ran the virtualenv command.

I.e. Within the folder '/venvs/' you ran: virtualenv --no-site-packages my-env

SO, now you should have: '/venvs/my-env/'

WITHIN the folder /venvs/my-env/ you should have three (3) folders: 'bin', 'include' and 'lib', (You may or may not occasionally see a temporary folder called 'build')

THEN you run (WITHIN the /venvs/my-env/ folder): source bin/activate

I would recommend installing Django using pip via: pip install Django

NOW you should have a file in /bin/ called django-admin.py which you call from the folder '/venvs/my-env/'

Douglas Denhartog
  • 2,036
  • 1
  • 16
  • 23
  • OK, so here's the deal. I'm running cygwin64 which has created a folder in C:/cygwin64/home/ called MyName. When I open cygwin this is the default folder so this is also where I created my virtualenv. The problem is, as I explained, that I don't have "bin", "include" and "lib". Instead I have C:/cygwin64/home/MyName/my-env. In this, I have 3 folders: "include", "lib", "scripts". However, the command "source my-env/Scripts/activate" worked. It didn't complain. The ONLY problem here is that after installing Django I have no django-admin.py. I tried uninstalling Django with pip but I couldn't. – Myone Feb 01 '14 at 08:20
  • Since this isn't exactly a duplicate but perhaps related, see the answers to a similar question at: [virtualenv --no-site-packages and pip still finding global packages?](http://stackoverflow.com/questions/1382925/virtualenv-no-site-packages-and-pip-still-finding-global-packages) – Douglas Denhartog Feb 03 '14 at 23:43
  • In short, a possible solution might be to `create the virtualenv`, activate it via `source`, use easy_install to install `pip` INTO the virtualenv, then use pip within the STILL activated virtualenv to install django! Good luck :) Keep me posted! – Douglas Denhartog Feb 03 '14 at 23:44