Frage

I'm trying to run a test-suite with tox for some work I'm doing on the jedi autocomplete library and I'm getting the following:

ValueError: Plugin already registered: /home/aldo/Documents/Projects/jedi/test/conftest.py=<module 'test.conftest' from '/home/aldo/Documents/Projects/jedi/test/conftest.py'>

The full output is available here:

https://gist.github.com/Astrac/5abdba7db62ac204325e

This is pytestdebug.log:

https://gist.github.com/Astrac/b5728dfeb22c0d2fb0f5

I tried running tox using pip in my main environment and running it within a clean virtual environment obtaining the same result. I also tried running py.test directly (from both my main environment and the virtual environment) but the result was the same.

On the other hand I know it works since I can see it running on travis:

https://travis-ci.org/davidhalter/jedi/jobs/5765531

Any help will be very appreciated, thank you!

War es hilfreich?

Lösung

I was getting this error message too. This is the first time I've tried making a setup.py or using tox so I was trying to copy examples I'd seen of other people's setup.py, since the official docs weren't very illuminating to me on this topic.

My broken setup.py looked like this:

from setuptools import setup, find_packages

setup(
    name='foobarbaz',
    version='1.0',
    author="donald duck",
    author_email="foo@bar.baz.quux",
    package_dir={'': 'src'},
    packages=find_packages('src'),
    zip_safe=False,
)

There were one or two problematic keyword arguments, it turns out. I removed package_dir and packages, then the problem went away. So this is the working version:

from setuptools import setup

setup(
    name='foobarbaz',
    version='1.0',
    author="donald duck",
    author_email="foo@bar.baz.quux",
    zip_safe=False,
)

I don't know if your situation is similar or if you've resolved this yet, but I this is what worked for me.

Andere Tipps

For those arriving here via google for "plugin already registered", I solved this similar issue by simply cleaning my env.

Specifically:

  1. Running pip uninstall on my package(s) e.g. pip uninstall foo
  2. Deleting any foo.egg-info/ or bar.egg-info/ directories created by installing my module as editable
  3. Reinstalling the virtualenv also works.

The root cause was that I had renamed my package from foo to bar, installing both in editable mode (pip install -e foo) and hadn't cleaned up the artefacts.

 setup(
-    name="foo",
+    name="bar",
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top