3
votes

I have installed the module "six", and it can be found by the PyCharm Interpreter.

PyCharm Interpreter:

enter image description here

However, PyCharm reports that it cannot resolve reference 'queue' which should be imported from six.

Unresolved reference queue:

enter image description here

2
Maybe you installed the wrong version? Check that moves is indeed present in the module. - dabadaba
This answer is relevant for working around this. stackoverflow.com/a/38720340/823942 - Matt R. Wilson

2 Answers

1
votes

Your code is fine. This is because moved attributes and modules in six are loaded lazily, therefore PyCharm cannot resolve the reference.

See source code for class Module_six_moves_urllib_parse in six.py.

0
votes

I had the same problem, if you have six imported you can import queue as follows:

import six
import queue

It just worked for me, hope it works for you as well.