Open strupy91 opened 2 years ago
Not a solution but a hint as to possible cause, pptx.Presentation
is a function that returns a pptx.presentation.Presentation
object: https://github.com/scanny/python-pptx/blob/master/pptx/api.py#L18.
So PyCharm might need some help making that connection. Some folks seem to have gotten it to work by importing both, but that might be a little tricky since you want to call the (factory) function and not construct the object directly: https://stackoverflow.com/a/52466366/1902513
Type annotations will help, but name collision indeed may introduce some confusion.
import pptx
from pptx.presentation import Presentation
with open("example_slide.pptx", "rb") as f:
presentation: Presentation = pptx.Presentation(f)
Has anyone a hint for autocompletion in Pycharm with pptx library. Other installed libraries working fine and it works in terminal. Maybe someone had the same problem? I tried different interpreter (2.7, 3.8, 3.10), installing with pip and github. Different versions from pptx. Windows, Linux. Pycharm, Visual Studio. But nothing worked.
Not working:
working: