You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had installed kaleido and plotly to the ubuntu server according instructions. But the error occurred:
Traceback (most recent call last):
File "kt.py", line 1, in
from kaleido.scopes.plotly import PlotlyScope
ModuleNotFoundError: No module named 'kaleido'
code is:
from kaleido.scopes.plotly import PlotlyScope
import plotly.graph_objects as go
scope = PlotlyScope()
fig = go.Figure(data=[go.Scatter(y=[1, 3, 2])])
with open("figure.png", "wb") as f:
f.write(scope.transform(fig, format="png"))
This is not an error I've seen so far. Did you install kaleido with pip or conda? Are you using a virtual environment or conda environment or installing into the system Python installation?
From the environment where you're running the script above, What is the result of
$ which python
We'll want to check if the kaleido python files were actually installed into the environment. So if the result of which python is {some_path}/bin/python, we'll want to check if there is a directory named kaleido in {some_path}/lib/python{python_version}/site-packages.
This is unexpected, it looks like an old pre-release was pulled down (0.0.1a1 instead of 0.0.1).
Version: 0.0.1a1
What version of Ubuntu are you using? I would expect 14.04+ to pull down the latest version automatically, but older versions might not. Kaleido should work with 14.04+ I don't expect that it will work with anything older.
If it's not a version older the 14.04, you could try explicitly specifying the version
The version of ubuntu is:
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-111-generic x86_64)
Something wrong ((
$ python3 -m pip install kaleido==0.0.1
Collecting kaleido==0.0.1
Could not find a version that satisfies the requirement kaleido==0.0.1 (from versions: 0.0.1a1)
No matching distribution found for kaleido==0.0.1
python3 -m pip install --user kaleido-0.0.1-py2.py3-none-manylinux2014_x86_64.whl
kaleido-0.0.1-py2.py3-none-manylinux2014_x86_64.whl is not a supported wheel on this platform.
What kind of hardware are you using? Kaleido is only compiled for 64-bit x86 CPU architecture (thats the manylinux2014_x86_64 part of the file name). Are you using an ARM processor or a 32-bit version of Ubuntu?
Ok, as far as I can tell this hardware is fine. Maybe you have an old version of pip that doesn't understand the manylinux2014 platform tag (https://www.python.org/dev/peps/pep-0599/).
It looks like you might have had a typo in the pip upgrade command. You want python3 -m pip install -U pip rather than python3 -m install -U pip. (although I may be misinterpreting the strikethough text above)
Also, I guess you'll need to specify the kaleido version to make sure it isn't already satisfied with 0.0.1a1. And just to be safe, also go ahead and uninstall the current kaleido version
one more question - how could I say to plotly right hight of the picture?
I have to calculate it
fig.write_image(id+".png", height = 30 + len(rows)*70)
but I do not know exatle hights of the rows. Where I could find real table size?
I don't think we have a good way to get the table height from Python at the moment. We are working on making it possible to get access to these kinds of layout properties from Python, but this hasn't been released yet.
@nicolaskruchten, do you think it will be possible to get a table trace's display height with the coming fig.coerce logic?
~/.../shared/!DEV $ python3 -m pip install kaleido
ERROR: Could not find a version that satisfies the requirement kaleido (from versions: none)
ERROR: No matching distribution found for kaleido
~/.../shared/!DEV $
Activity
jonmmease commentedon Jul 21, 2020
Hi @YuriyMikheev, thanks for letting us know.
This is not an error I've seen so far. Did you install
kaleidowith pip or conda? Are you using a virtual environment or conda environment or installing into the system Python installation?From the environment where you're running the script above, What is the result of
We'll want to check if the kaleido python files were actually installed into the environment. So if the result of
which pythonis{some_path}/bin/python, we'll want to check if there is a directory namedkaleidoin{some_path}/lib/python{python_version}/site-packages.YuriyMikheev commentedon Jul 21, 2020
Hi @jonmmease !
Thank you!
I installed python into the system Python installation.
$ which python3
/usr/bin/python3
but site-packages are in ~/.local/lib/python3.6
should I copy it in /usr/lib ?
YuriyMikheev commentedon Jul 21, 2020
I found out that ~/.local/lib/python3.6/site-packages there is no kaliedo (( there is the only kaliedo-xxx-dist-info
jonmmease commentedon Jul 21, 2020
Does this help
Using
python3 -m pipinstead ofpipshould ensure that kaleido is installed into thepython3environment.If not, could you include the output of
This should display the path to where pip thinks kaleido was installed.
YuriyMikheev commentedon Jul 21, 2020
I have done it but it does't help
~$ python3 -m pip show kaleido
Name: kaleido
Version: 0.0.1a1
Summary: Stay tuned!
Home-page: UNKNOWN
Author: Jon Mease
Author-email: UNKNOWN
License: UNKNOWN
Location: /home/yuriy/.local/lib/python3.6/site-packages
Requires:
There is no kaleido in /home/yuriy/.local/lib/python3.6/site-packages
jonmmease commentedon Jul 21, 2020
This is unexpected, it looks like an old pre-release was pulled down (
0.0.1a1instead of0.0.1).What version of Ubuntu are you using? I would expect 14.04+ to pull down the latest version automatically, but older versions might not. Kaleido should work with 14.04+ I don't expect that it will work with anything older.
If it's not a version older the 14.04, you could try explicitly specifying the version
YuriyMikheev commentedon Jul 22, 2020
The version of ubuntu is:
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-111-generic x86_64)
Something wrong ((
$ python3 -m pip install kaleido==0.0.1
Collecting kaleido==0.0.1
Could not find a version that satisfies the requirement kaleido==0.0.1 (from versions: 0.0.1a1)
No matching distribution found for kaleido==0.0.1
YuriyMikheev commentedon Jul 22, 2020
I tried to install manually from https://pypi.org/project/kaleido/0.0.1/#files
but the response is:
python3 -m pip install --user kaleido-0.0.1-py2.py3-none-manylinux2014_x86_64.whl
kaleido-0.0.1-py2.py3-none-manylinux2014_x86_64.whl is not a supported wheel on this platform.
jonmmease commentedon Jul 22, 2020
What kind of hardware are you using? Kaleido is only compiled for 64-bit x86 CPU architecture (thats the
manylinux2014_x86_64part of the file name). Are you using an ARM processor or a 32-bit version of Ubuntu?Cross reference #7
YuriyMikheev commentedon Jul 22, 2020
That is VDS
$ lscpu
Архитектура: x86_64
CPU op-mode(s): 32-bit, 64-bit
Порядок байт: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Потоков на ядро: 1
Ядер на сокет: 1
Сокетов: 1
NUMA node(s): 1
ID прроизводителя: GenuineIntel
Семейство ЦПУ: 6
Модель: 79
Имя модели: Intel(R) Xeon(R) CPU E5-2658 v4 @ 2.30GHz
Степпинг: 1
CPU МГц: 2294.682
BogoMIPS: 4589.36
Разработчик гипервизора: Microsoft
Тип виртуализации: полный
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 35840K
NUMA node0 CPU(s): 0
Флаги: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch pti fsgsbase bmi1 hle avx2 smep bmi2 erms rtm rdseed adx smap xsaveopt
jonmmease commentedon Jul 22, 2020
Ok, as far as I can tell this hardware is fine. Maybe you have an old version of pip that doesn't understand the
manylinux2014platform tag (https://www.python.org/dev/peps/pep-0599/).Try
YuriyMikheev commentedon Jul 22, 2020
Hi!
Thank you for your help!
But it doesn't affect the situation
$ python3 -m install -U pip
/usr/bin/python3: No module named install
yuriy@ruvds-djyn9:
$ python3 -m pip install -U pip$ python3 -m pip install kaleidoCollecting pip
Downloading https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl (1.5MB)
100% |████████████████████████████████| 1.5MB 542kB/s
Installing collected packages: pip
Successfully installed pip-20.1.1
yuriy@ruvds-djyn9:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: kaleido in /usr/local/lib/python3.6/dist-packages (0.0.1a1)
yuriy@ruvds-djyn9:
$ python3 -m pip --version$pip 20.1.1 from /home/yuriy/.local/lib/python3.6/site-packages/pip (python 3.6)
yuriy@ruvds-djyn9:
jonmmease commentedon Jul 22, 2020
It looks like you might have had a typo in the pip upgrade command. You want
python3 -m pip install -U piprather thanpython3 -m install -U pip. (although I may be misinterpreting the strikethough text above)Also, I guess you'll need to specify the kaleido version to make sure it isn't already satisfied with
0.0.1a1. And just to be safe, also go ahead and uninstall the current kaleido versionYuriyMikheev commentedon Jul 22, 2020
Super! Thank you! it works :)
one more question - how could I say to plotly right hight of the picture?
I have to calculate it
fig.write_image(id+".png", height = 30 + len(rows)*70)
but I do not know exatle hights of the rows. Where I could find real table size?
jonmmease commentedon Jul 22, 2020
Great!
I don't think we have a good way to get the table height from Python at the moment. We are working on making it possible to get access to these kinds of layout properties from Python, but this hasn't been released yet.
@nicolaskruchten, do you think it will be possible to get a
tabletrace's display height with the comingfig.coercelogic?nicolaskruchten commentedon Jul 22, 2020
Re the table height, I recommend you check out our "Paper coordinates" documentation: https://plotly.com/python/figure-structure/#positioning-with-paper-or-container-coordinates
Basically the height of the figure is either given or default, and the margins define the bounds of paper coordinates.
mablue commentedon Feb 6, 2022
termux error: