Warning of 'Unused import statement' even though module is used ???
Hi,
I have some code like
where 'config' is marked as 'unused import statement' and is greyed out even though it is used very obviously. However through the general import from models the 'config' module gets imported again (which PyCharm probably detects), maybe that is the reason.
But: config is needed before the import of 'models', so 'Unused import' is not really right ... (and it fooled me to remove the import statement which caused by tests to fail of course ...)
I've had the problem in PyCharm 3.1, 3.3 and also now after the upgrade to 3.4.1 (OS X and Linux).
Possible bug?
Ralph
I have some code like
import config dbDriver = config.lims.database.driver connectFunc[dbDriver](config.auth.oracle.lims, config.lims.database.verbose) from models import *
where 'config' is marked as 'unused import statement' and is greyed out even though it is used very obviously. However through the general import from models the 'config' module gets imported again (which PyCharm probably detects), maybe that is the reason.
But: config is needed before the import of 'models', so 'Unused import' is not really right ... (and it fooled me to remove the import statement which caused by tests to fail of course ...)
I've had the problem in PyCharm 3.1, 3.3 and also now after the upgrade to 3.4.1 (OS X and Linux).
Possible bug?
Ralph
Please sign in to leave a comment.
I'm experiencing a similar issue.
For example, the class MyClass is used in file my_file.py.
Refactor MyClass and move it to another file other_file.py.
Now my_file.py is still using MyClass, but the import of other_file.py
I tried File -> Invalidate Caches and Restart. PyCharm version 2016.2.3