1

I am trying to develop a python package that is importable and also has entry_point to call from shell.

When trying to call the entry point I get: pkg_resources.VersionConflict: (pysec-aws 0.1.dev1 (/Users/myuser/PycharmProjects/pysec-aws), Requirement.parse('pysec-aws==0.1.dev0'))

Essentially what I did before getting this error, is incrementing the version from 0.1.dev0 to 0.1.dev1 in setup.py, and running python setup.py sdist and then pip install -e .

What am I doing wrong? What is the proper way to install development versions of packages you are actively developing and bundling with setuptools?

2
  • do you get this error when launching code from pysec-aws package itself or another package depending on it? Also, the complete error trace along with the setup.py skeleton would be nice. Commented Dec 22, 2017 at 21:48
  • 1
    My guess is that you have some other package that declares an entry point to pysec-aws and declares dependency on pysec-aws of exact version 0.1.dev0. Now you bumped pysec-aws to 0.1.dev1 so the other package has no valid dependency anymore, and this is what is checked when pkg_resources loads the entry points. Commented Dec 22, 2017 at 21:50

2 Answers 2

1

The error is complaining that the application version does not match the version declared in setup.py. Try checking the __version__ set in your application.

You might consider using a single source for the version to avoid this problem. There are a number of different options outlined at https://packaging.python.org/guides/single-sourcing-package-version/. One simple technique, if there are not any external dependencies, is

import myapp
setup(
    ...
    version=myapp.__version__
    ...
)
Sign up to request clarification or add additional context in comments.

5 Comments

I don't have a manifest file, and I do have package dependencies. Where should __version__ be defined?
I added __version__='0.1dev1' to my __init__.py file and used the first technique in the link you provided. The package builds and is installed fine as before, but when I try to invoke entry_point from shell, I get the same error
@EytanAvisror by manifest I meant the setup.py declared version. I will fix that. As for the error, do you still have a reference to 0.1.dev0 somewhere in your project? (Note it looks like you lost a period in your comment's referenced version)
No references for dev0 anywhere.. by the way, when I change __version__ back to 0.1.dev0 and install it it works.
I am not sure, sorry. The only other thing that comes to mind is something like this packaging.python.org/guides/multi-version-installs if you had a previous install leftover but I don't know if it would cause this error or not.
0

The only thing that fixed this issue was to create a new virtualenv.

Apparently my virtualenv/bin had compiled (.pyc) and non-compiled (.py) references to the old version for some reason - they were probably not upgraded / removed when I installed the new version.

Once I created a new virtualenv and re-installed required packages I was able to resolve this issue.

1 Comment

Ah, I am happy to hear you resolved the problem. In your case you mentioned both source and compiled source. For what it is worth, I had a case once where leftover .pyc alone (not venv related) caused a problem. I have forgotten the details but I think I found that problem by having some incongruous grep results.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.