Question

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.

Was it helpful?

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.

OTHER TIPS

Your problem occurs when installing you package with editable mode off:

pip install ... or python setup.py install

You can either install package with editable mode on (as it was already mentioned):

pip install -e . or python setup.py develop

or you can add some additional arguments to setup.py:

setup(
    ...,
    include_package_data=True,
    packages=find_packages(),
    zip_safe=False,
)

After applying these modifications you will be able to install your package properly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top