0
votes

I am using eclipse pydev for my python project and I have a module where I use shelve. The import of shelve is marked as unresolved in the editor but the programs runs correctly. When I comment the import it no longer works.

How comes the shelve module is working despite unresolved import?

I signal I use python from a virtual env

1

1 Answers

0
votes

My guess is that your PYTHONPATH is not properly adding the lib folder where shelve is defined within Eclipse/PyDev.

To check it do the following: create a program with:

import shelve
import os
print(os.path.dirname(shelve.__file__))

Run it and then check in the interpreter configuration (in the interpreter preferences) if that folder is actually added there.