|In Brief||A quick and dirty way to check if another distribution is installed, and to error if it is. This works well at the top of a setup.py file.... more|
2from pkg_resources import require, DistributionNotFound, VersionConflict
7 print 'You have ConflictingDistribution installed.'
8 print 'You need to remove ConflictingDistribution from your site-packages'
9 print 'before installing this software, or conflicts may result.'
13except (DistributionNotFound, VersionConflict):
A quick and dirty way to check if another distribution is installed, and to error if it is. This works well at the top of a setup.py file.
Replace 'ConflictingDistribution' with your own conflicting distribution.
You can also only error on certain versions of the conflicting distrubtion by requiring those: require('ConflictingDistribution<1.0'). Of course you'll probably want a better error message then :).