I have a relative simple problem with Pycharm. It seems to ignore some members of packages such as Pygame or PyEphem. For instance, when I type ephem + dot, Pycharm shows me just a few classes and functions avaliable for this package, ignoring many classes such as Uranus (I can make an assignment x = ephem.Uranus() without any errors, but Pycharm doesnt show me any avaliable methods for x). I use standard syntax:
import ephem
I always work on fresh virtualenv. I have checked interpreter paths. PyEphem is obviously installed for my environment. What may cause the problem here?
The problem is that PyEphem does not list objects like Uranus literally in the text of its __init__.py
file, but instead loads them dynamically by scanning a table inside of the C library "libastro" that PyEphem is a mere wrapper around. Since it cannot see the name Uranus
anywhere in the text of the Python module, PyCharm does not know that it will be there at runtime.
If you open an Issue on GitHub, I will get this fixed in the next version by pivoting away from the table-driven code and toward a literal list of planets!