Search code examples
pythondjangomercurialmigratesetup.py

Django: Can't migrate app installed from source


I have a virtualenv set up to do my install. All of these I run in a virtualenv:

$ hg clone https://bitbucket.org/tonioo/cmsplugin-poll
$ cd cmsplugin-poll
$ python setup.py install

This is the output I get: http://pastebin.com/XCX4bUiA.

$ cd project-dir/
$ python manage.py migrate
OSError: [Errno 20] Not a directory: '$VIRTUAL_ENV/local/lib/python2.7/site-packages/cmsplugin_poll-0.3-py2.7.egg/cmsplugin_poll/migrations'

As expected, cmsplugin_poll-0.3-py2.7.egg is an egg, not a directory. This works fine if I use install cmsplugin-poll via pip but I want to fix something in this package.

I already tried the following:

  • Deleting and recreating the virtualenv
  • Installing as root (I know--this wouldn't help anything)
  • rm -r cmsplugin_poll* from the site-packages directory
  • Delete and redownload the repo.
  • Upgrading everything, including pip.

Any ideas? Thank you in advance.


Solution

  • If your going to work on the package sources, then you shouldn't try installing it with your Python site—this will copy the sources to the interpreter's site folder, but depending on how the setup script is configured, essentials might be discarded, including test sources and other package-private bits unrelated to using it as a contributing package in other projects.

    Instead you should try to do python setup.py develop. The sources will be only be registered as a package path entry with your site, but you'll remain with full access to anything distributed with the package.