-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.0.2 cannot import name 'PlotlyScope' on Windows venv #22
Comments
Hi @WEGFan, what version of the |
Both are 4.9.0 |
Oh I forgot to say I add a line in try:
from kaleido.scopes.plotly import PlotlyScope
scope = PlotlyScope()
# Compute absolute path to the 'plotly/package_data/' directory
root_dir = os.path.dirname(os.path.abspath(plotly.__file__))
package_dir = os.path.join(root_dir, "package_data")
scope.plotlyjs = os.path.join(package_dir, "plotly.min.js")
scope.mathjax = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"
except ImportError:
raise # here
PlotlyScope = None
scope = None |
Thanks for info the debugging @WEGFan. I'm not able to reproduce yet, but there is a circular import here that we might as well get rid of. In Here is a PR that does this: #25. Could you give this a try (The change is moving a single line, so you could edit it manually as you did above). |
It worked, but I still wonder why it happened only in venv... |
Great! I'm also not sure what is going on with the virtual environment there. Until we get the next release out, I'm pretty sure you wouldn't run into this issue if you could use Python 3.7+ in your venv since plotly.py imports submodules, like |
This fix has been released in version 0.0.3 |
It seems like it's a circular import problem and #18 causes it, but neither Linux with venv nor Windows without venv has this issue.
I'm using Python 3.6.8 on Windows and 3.6.2 on Linux.
The text was updated successfully, but these errors were encountered: