Eclipse/pydev can't resolve module


Keywords:eclipse 


Question: 

I'm using PyDev within Eclipse (Oxygen) and have Python 3.6 installed. The Preferences and project properties both show Python 3.6 being used. But when I try to use calendar, I get

<bound method TextCalendar.formatyear of <calendar.TextCalendar object at 0x1073839e8>>

when I print it out. And Eclipse/PyDev can't resolve calendar

In idle3 if I print out calendar, it shows that it's coming from Python 3.6,

<module 'calendar' from '/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/calendar.py'>

How do I get this properly configured?

Thanks.


1 Answer: 

My imports included:

from calendar import calendar

This is what caused the problem. Changing it to just

import calendar

got the correct module.