Advice on installing Django in a fresh OSX Lion machine

57 views
Skip to first unread message

Paulo

unread,
Apr 9, 2012, 8:19:28 AM4/9/12
to Django users
Im new both to Python and Django and I'm afraid of messing thins up
before I even start.
Lion ships with Python 2.7.1 but I see that 2.7.2 is available in the
official site. Should I download .dmg file from the site to update to
version 2.7.2?
I found this tutorial [1] and I really like the idea of a virtual
development "folder" so I don't mess things up in my system. Could I
get some advice on that site tutorial?
Like I said, I'm new to python and only read the Byte of Python book
so far, but I want to move to web because Im tired of being a CMS
tweaker. Is Django a good choice for that or should I try another
framework? (I want to build my portfolio site and use it as a learning
process)

Thanks in advance and excuse my poor english

[1] - http://hackercodex.com/2011/08/30/python-install-django-on-mac-osx-lion-10.7/

shacker

unread,
Apr 9, 2012, 11:23:09 AM4/9/12
to django...@googlegroups.com
On Monday, April 9, 2012 5:19:28 AM UTC-7, Paulo wrote:
Im new both to Python and Django and I'm afraid of messing thins up
before I even start.
Lion ships with Python 2.7.1  but I see that 2.7.2 is available in the
official site. Should I download .dmg file from the site to update to
version 2.7.2?

I personally wouldn't bother messing with the default python for such a minor update on your local dev machine. Your steps should be:

sudo easy_install pip
sudo pip install virtualenvwrapper
  [Follow its post-setup instructions, then]
mkvirtualenv yoursite
workon yoursite
pip install django


Paulo

unread,
Apr 9, 2012, 4:59:19 PM4/9/12
to django...@googlegroups.com
Thanks for the reply.

Paulo

unread,
Apr 9, 2012, 7:00:32 PM4/9/12
to django...@googlegroups.com
So I follow your advice and did sudo easy_install pip and sudo pip install virtualenvwrapper.
Then I instaled homebrew and wget as mentioned in the site. And then I hit the wall. 
When I tried to python setup.py install --prefix=~/.local the return was a error:

Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Not patching, --root or --prefix is installing Distribute in another location
running install
Checking .pth file support in /Users/Paulo/.local/lib/python2.7/site-packages/
/usr/bin/python -E -c pass
TEST FAILED: /Users/Paulo/.local/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Users/Paulo/.local/lib/python2.7/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:


Please make the appropriate changes for your system and try again.

I dont know how to fix it. The site's tutorial doesn't mention any path untill that point and I am very lost here.
Any help please?
Thanks in advance

Daniel Roseman

unread,
Apr 10, 2012, 7:59:50 AM4/10/12
to django...@googlegroups.com
On Tuesday, 10 April 2012 00:00:32 UTC+1, Paulo wrote:
So I follow your advice and did sudo easy_install pip and sudo pip install virtualenvwrapper.
Then I instaled homebrew and wget as mentioned in the site. And then I hit the wall. 
When I tried to python setup.py install --prefix=~/.local the return was a error:


Which bit of advice is this following? None of shacker's steps seem to involve running setup.py.
--
DR.

Paulo

unread,
Apr 10, 2012, 11:10:33 AM4/10/12
to django...@googlegroups.com
You're right it doesn't. What I meant was, that I installed pip and virtualenvwrapper and THEN followed the tutorial as he advised.
But today I uninstalled virtualenv and virtualenvwrapper and following the tutorial [1] instructionsand everything seems to work now.
Thanks for helping.

Reply all
Reply to author
Forward
0 new messages