Repository navigation
Autocomplete not working in Pycharm #1682
Description
Activity
Hi @Shourai, thanks for the report.
What version of PyCharm are you using? I mostly develop plotly.py in PyCharm and I've not seen this problem before. Here's what I get when I create a simple PyCharm project on MacOS with PyCharm version 2019.1.3 with an environment with plotly.py 4.0.0 installed.
Hey @jonmmease, thanks for your work on plotly!
The screenshots in the first post were taken on Pycharm 2019.1.3 Professional edition on Windows 10.
I could have sworn it was working before the update to plotly 4.0.
After downgrading plotly to 3.10 it is not working either.A few minutes after I posted the issue Pycharm version 2019.2 came out, so I thought about removing everything and installing pycharm from scratch without any plugins.
Created a new virtual environment and only installed plotly 4.0
However it still does not work.Tried it also with Pycharm 2019.2 on a mac running Mojave, no luck there either.
plotly.expressis working however.Reacted by Jan GirmanHi All, I'm still now sure why this is happening for some folks. One thing that we can in 4.2 that might help is that we'll switch things around and output the code generation to the
plotly.graph_objectsdirectory, and have the alias point fromplotly.graph_objstoplotly.graph_objectsinstead of the other way around.Reacted by Igor RogattyI still wonder if all has something to do with it...
It looks like it has something to do with the graphs_object file being to big:

This can be solved (on mac) by going to:
Help > Edit Custom Properties
Then add:
idea.max.intellisense.filesize=500000Then restart Pycharm
(Stackoverflow link)Reacted by Y and bernard778Reacted by Shourai and Nicolas Rothenhäuslerthe same problem in vscode use pylance language server .anyone have suggest?
There is a related issue for pylance microsoft/pylance-release#512
Why this customrelative_importhack is needed?How about changing if guard here
https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/graph_objs/__init__.py
toif sys.version_info < (3, 7) or TYPE_CHECKING:
this solves an issue with vscode+pylance for me, and in runtime the import is still lazy.
Shall I make a PR?Reacted by Joshua Ellis and YoannLooks like this issue might be a duplicate of #1103 ?
This issue will be resolved in the next version of Plotly.py which will come out in a few days, and includes some goodies like #3708 which lets you autocomplete off of the result of functions like
px.scatter()as well :)




While using plotly 4.0 combined with Pycharm the autocompletion for
plotly.graph_objectsis not working.Also the references to the objects are not found either, but the script does work.
I see some people on the community site with the same issue.
Works fine for e.g. pandas:
No completion is found when I type
go.either.However when I use
import plotly.graph_objs as go, the references are found.But the autocompletion still doesn't work.
I have tried
File > Invalidate Cache/Restart, to no avail.There has been an issue like this before but it seems it had been solved: #389
When I open the same virtualenv within VScode the autocompletion works fine.

(The extension uses jedi for autocompletion I think).
I am not sure if this is an issue with plotly or pycharm.