python manage.py migrate results in Unknown command: 'migrate'

1,576 views
Skip to first unread message

Nik B

unread,
Mar 21, 2013, 3:39:35 PM3/21/13
to opentree...@googlegroups.com
Hello,

I've managed to successfully run the python manage.py syncdb command, but when I try to run python manage.py migrate, I get an unknown command: 'migrate' error.

I'm new to all of this stuff, so please be kind!

Regards,

Nik

Adam Hinz

unread,
Mar 21, 2013, 3:41:31 PM3/21/13
to opentree...@googlegroups.com
Hey Nik,

You may want to try installing all the requirements from the
"requirements.txt" file in the current development version (1.3):

https://github.com/azavea/OpenTreeMap/blob/v1.3/requirements.txt

Then you should be able to install them all with:
pip install -r requirements.txt

If all goes well, you should have the migrate command.

If you're just starting I would recommend moving to the v1.3 branch.

-Adam
--

Adam Hinz
Software Engineer, Azavea
ad...@adamhinz.com | c: 608-445-8391 | Twitter: @ahinz

Nik B

unread,
Mar 21, 2013, 4:09:52 PM3/21/13
to opentree...@googlegroups.com
I will definitely try that.

At the moment I've followed all the steps in 'Install Process on Ubuntu 12.04'. But get stuck at the migrate step.

If I follow the steps in the above tutorial, using v1.3 instead, should I get the same results (w/ the migrate command)?

Regards,

Nik

Nik B

unread,
Mar 21, 2013, 4:11:34 PM3/21/13
to opentree...@googlegroups.com
Also, can you further explain how I install them all from the requirements.txt file? Do you mean I don't need to execute an apt-get install command for each program?

Adam Hinz

unread,
Mar 21, 2013, 4:14:40 PM3/21/13
to opentree...@googlegroups.com
This should get you much closer than using apt. There are still a few
dependencies that you'll have to install yourself (mostly GDAL) which
you should use apt for.

v1.2 is very similar to v1.3, with the except of a few minor changes and
default template improvements, so my guess is that the instructions
probable continue to work.

Nik B

unread,
Mar 21, 2013, 4:19:34 PM3/21/13
to opentree...@googlegroups.com
If I understand you correctly, I should clone the git of v1.3 into my site root directory and then execute pip install -r requirements.txt?

Andrew Thompson

unread,
Mar 21, 2013, 4:25:27 PM3/21/13
to opentree...@googlegroups.com
Hi Nik,

Yes, clone the repository. Then, you may need to "python easy_install pip" first. If you're unfamiliar with pip: http://www.pip-installer.org/en/latest/installing.html . A virtual environment is also probably a good idea.


--
You received this message because you are subscribed to the Google Groups "opentreemap-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentreemap-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Andrew Thompson, Community Evangelist

Azavea |  340 N 12th St, Ste 402, Philadelphia, PA
atho...@azavea.com  | T 215.701.7689  | F 215.925.2663
Web azavea.com  |  Blog azavea.com/blogs  | Twitter @azavea

Join our community! Google Groups:

Andrew Thompson

unread,
Mar 21, 2013, 4:27:54 PM3/21/13
to opentree...@googlegroups.com
If you're unfamiliar with virtual environments (virtualenv): http://www.virtualenv.org/en/latest/

Nik B

unread,
Mar 21, 2013, 4:42:14 PM3/21/13
to opentree...@googlegroups.com
Yup. I'm officially lost.

Nik B

unread,
Mar 21, 2013, 4:50:50 PM3/21/13
to opentree...@googlegroups.com
Just to give some context:

I'm using linode configured with Ubuntu 12.04. I'm working with a couple of stakeholders in Toronto, Canada to develop a treemap for the city (so I'm really excited that v1.3 has some international settings).

Where I'm stuck? I don't know which steps I should be taking first or where to clone the repository to even begin executing requirements.txt or how the pip install and virtualenv fit in and which I should setup first.

As I mentioned, I had somewhat successfully followed the steps in the installing process on ubuntu tutorial and it had cloned the v1.2 git into the /var/www folder after all the includes/programs were installed. Got stuck on the python manage.py migrate command.

Would you be able to give me steps 1, 2, 3 to help me sort out the order of what I should be doing to get on my way to having OTM implemented?

 Many, many thanks in advance...

Nik.

Nik B

unread,
Mar 21, 2013, 10:10:56 PM3/21/13
to opentree...@googlegroups.com
Hi Adam,

I tried installing the requirements from the requirements.txt fail but ran into some errors as follows:

*******

(my_env)root@zutzoot:~# pip install -r requirements.txt 
Downloading/unpacking http://downloads.sourceforge.net/project/dbfpy/dbfpy/2.2.5/dbfpy-2.2.5.tar.gz (from -r requirements.txt (line 1))
  Downloading dbfpy-2.2.5.tar.gz
Downloading/unpacking BeautifulSoup==3.2.0 (from -r requirements.txt (line 2))
  Running setup.py egg_info for package BeautifulSoup
Downloading/unpacking Django==1.3.4 (from -r requirements.txt (line 3))
  Running setup.py egg_info for package Django
Downloading/unpacking PIL==1.1.7 (from -r requirements.txt (line 4))
  Running setup.py egg_info for package PIL
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py
Downloading/unpacking South==0.7.5 (from -r requirements.txt (line 5))
  Running setup.py egg_info for package South
Downloading/unpacking Unidecode==0.04.9 (from -r requirements.txt (line 6))
  Running setup.py egg_info for package Unidecode
Downloading/unpacking django-badges==0.1.6 (from -r requirements.txt (line 7))
  Running setup.py egg_info for package django-badges
Downloading/unpacking django-debug-toolbar==0.9.1 (from -r requirements.txt (line 8))
  Running setup.py egg_info for package django-debug-toolbar
Downloading/unpacking django-extensions==0.7.1 (from -r requirements.txt (line 9))
  Running setup.py egg_info for package django-extensions
Downloading/unpacking django-pagination==1.0.7 (from -r requirements.txt (line 10))
  Running setup.py egg_info for package django-pagination
Downloading/unpacking django-profiles==0.2 (from -r requirements.txt (line 11))
  Running setup.py egg_info for package django-profiles
Downloading/unpacking django-shapes==0.2.0 (from -r requirements.txt (line 12))
  Running setup.py egg_info for package django-shapes
Downloading/unpacking django-sorting==0.1 (from -r requirements.txt (line 13))
  Running setup.py egg_info for package django-sorting
Downloading/unpacking django-tagging==0.3.1 (from -r requirements.txt (line 14))
  Running setup.py egg_info for package django-tagging
Downloading/unpacking django-threadedcomments (from -r requirements.txt (line 15))
  Running setup.py egg_info for package django-threadedcomments
Downloading/unpacking django-pipeline==1.1.27 (from -r requirements.txt (line 16))
  Running setup.py egg_info for package django-pipeline
Downloading/unpacking feedparser==5.1 (from -r requirements.txt (line 17))
  Running setup.py egg_info for package feedparser
Downloading/unpacking geopy==0.94.1 (from -r requirements.txt (line 18))
  Running setup.py egg_info for package geopy
Downloading/unpacking gunicorn==0.14.3 (from -r requirements.txt (line 19))
  Running setup.py egg_info for package gunicorn
Downloading/unpacking psycopg2==2.4.1 (from -r requirements.txt (line 20))
  Running setup.py egg_info for package psycopg2
    Error: pg_config executable not found.
    
    Please add the directory containing pg_config to the PATH
    or specify the full executable path with the option:
    
        python setup.py build_ext --pg-config /path/to/pg_config build ...
    
    or with the pg_config option in 'setup.cfg'.
    Complete output from command python setup.py egg_info:
    running egg_info

writing pip-egg-info/psycopg2.egg-info/PKG-INFO

writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt

writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found

Error: pg_config executable not found.



Please add the directory containing pg_config to the PATH

or specify the full executable path with the option:



    python setup.py build_ext --pg-config /path/to/pg_config build ...



or with the pg_config option in 'setup.cfg'.

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /root/my_env/build/psycopg2

*******

Any ideas?

On Thursday, March 21, 2013 3:41:31 PM UTC-4, Adam Hinz wrote:

Adam Hinz

unread,
Mar 21, 2013, 11:01:47 PM3/21/13
to opentree...@googlegroups.com
Ah, pretty close!

You probably need to install postgres development files:
sudo apt-get install postgresql-dev

Since migrate worked, it sounds like you already have postgres installed.


--
You received this message because you are subscribed to the Google Groups "opentreemap-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentreemap-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
Adam Hinz
Software Engineer, Azavea
hinz...@gmail.com | c: 608-445-8391 | Twitter: @ahinz

Nik B

unread,
Mar 22, 2013, 5:47:54 PM3/22/13
to opentree...@googlegroups.com
Cool!

So should I start over and install postgres-dev before running the requirements.txt? Or will it work if I install it and then just execute requirements.txt again?

Also.. Out of curiosity.. How can you tell from what I posted that migrate worked? (Newb)

Many many thanks,

Nikesh.

Message has been deleted

Andrew Thompson

unread,
Mar 22, 2013, 5:59:31 PM3/22/13
to opentree...@googlegroups.com
Hi Nikesh,

I think you should be able to proceed by installing postgres-dev as Adam suggested, then re-running the requirements.txt command - which then should not produce any errors.

Adam knows that migrate worked from what you posted because the migrate command is actually part of a Python/django package called "South" - http://south.readthedocs.org/en/0.7.6/ . We use it for *migrating* databases between different versions of OpenTreeMap.

-Andrew


--
You received this message because you are subscribed to the Google Groups "opentreemap-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentreemap-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--

Nik B

unread,
Mar 22, 2013, 7:23:04 PM3/22/13
to opentree...@googlegroups.com
hi andrew,

thanks for your response. i tried apt-get install postgres-dev, but it said the package didnt exist. it instead suggested to install libpq-dev so i did that and reran the requirements.txt file, but got the same error.

I'm really not sure why this is happening. Any thoughts?

Best,
Nikesh
Reply all
Reply to author
Forward
0 new messages