Gang
Gang

Reputation: 2778

How to check import aliases conflict in python?

I had a few conflicts like this, how to check whether there is similar import aliases in a existing large project? What rule this import violated?

import os.stat as stat
import stat

stat.S_IWRITE
stat(filename).st_mode

Upvotes: 1

Views: 70

Answers (1)

gary
gary

Reputation: 695

I have found that running python with the -v option has been invaluable in debugging python import issues. For example:

python -v script.py

Review the console and search (find, grep, etc, whichever command you are comfortable with) for each package having the import issue. You should be able to fairly quickly locate the spot where the imports go awry.

Upvotes: 1

Related Questions