Skip to content

installation issue #15

Closed
Closed

Description

@YuriyMikheev

Hi!

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"))

what problem is?
how could I correct it?

Activity

  1. jonmmease commented on Jul 21, 2020

    @jonmmease
    Collaborator

    Hi @YuriyMikheev, thanks for letting us know.

    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.

  2. YuriyMikheev commented on Jul 21, 2020

    @YuriyMikheev
    Author

    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 ?

  3. YuriyMikheev commented on Jul 21, 2020

    @YuriyMikheev
    Author

    I found out that ~/.local/lib/python3.6/site-packages there is no kaliedo (( there is the only kaliedo-xxx-dist-info

  4. jonmmease commented on Jul 21, 2020

    @jonmmease
    Collaborator

    Does this help

    $ python3 -m pip uninstall kaleido
    $ python3 -m pip install kaleido
    

    Using python3 -m pip instead of pip should ensure that kaleido is installed into the python3 environment.

    If not, could you include the output of

    $ python3 -m pip show kaleido
    

    This should display the path to where pip thinks kaleido was installed.

  5. YuriyMikheev commented on Jul 21, 2020

    @YuriyMikheev
    Author

    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

  6. jonmmease commented on Jul 21, 2020

    @jonmmease
    Collaborator

    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

    $ python3 -m pip install kaleido==0.0.1
    
  7. YuriyMikheev commented on Jul 22, 2020

    @YuriyMikheev
    Author

    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

  8. YuriyMikheev commented on Jul 22, 2020

    @YuriyMikheev
    Author

    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.

  9. jonmmease commented on Jul 22, 2020

    @jonmmease
    Collaborator

    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?

    Cross reference #7

  10. YuriyMikheev commented on Jul 22, 2020

    @YuriyMikheev
    Author

    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

  11. jonmmease commented on Jul 22, 2020

    @jonmmease
    Collaborator

    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/).

    Try

    $ python3 -m pip install -U pip
    $ python3 -m pip install kaleido
    $ python3 -m pip --version
    
  12. YuriyMikheev commented on Jul 22, 2020

    @YuriyMikheev
    Author

    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
    Collecting 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:
    $ python3 -m pip install kaleido
    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:
    $

  13. jonmmease commented on Jul 22, 2020

    @jonmmease
    Collaborator

    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

    $ python3 -m pip install -U pip
    $ python3 -m pip uninstall kaleido
    $ python3 -m pip install kaleido==0.0.1
    $ python3 -m pip --version
    
  14. YuriyMikheev commented on Jul 22, 2020

    @YuriyMikheev
    Author

    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?

    image


  15. jonmmease commented on Jul 22, 2020

    @jonmmease
    Collaborator

    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 table trace's display height with the coming fig.coerce logic?

  16. nicolaskruchten commented on Jul 22, 2020

    @nicolaskruchten

    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.

  17. mablue commented on Feb 6, 2022

    @mablue

    termux error:

    ~/.../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 $
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions