Skip to main content
Seasoned ⭐️⭐️⭐️
October 12, 2023
Solved

Python with puodide

  • October 12, 2023
  • 8 replies
  • 227 views

I am trying to install some python packages that do not appear to have a wheel which turns into a problem because , as far as I know, pyodide is not able to install packages without a wheel. Here is an example of an error I am receiving  - “Can't find a pure Python 3 wheel for 'psutil==5.9.5'.”-

How can I address this issue in Jupyter Notebook and streamlit? Is there a workaround? Is there a way to use a different kernel instead of pyodide?

I am not facing this issue with CDF functions. How does CDF functions environment differ from Jupyter Notebook and streamlit?

    Best answer by Murad Sæter

    Jypyter notebooks in CDF is running inside your browser and is based on pyodide. There is a subset of packages that works with pyodide. psutil seems like something wouldn’t work here.

    There workaround is to install jupyter / python locally on your computer.

    CDF functions runs in a normal python environment, so that’s different.

    8 replies

    Murad Sæter
    Practitioner ⭐️⭐️⭐️
    Practitioner ⭐️⭐️⭐️
    October 13, 2023

    Jypyter notebooks in CDF is running inside your browser and is based on pyodide. There is a subset of packages that works with pyodide. psutil seems like something wouldn’t work here.

    There workaround is to install jupyter / python locally on your computer.

    CDF functions runs in a normal python environment, so that’s different.

    Expert ⭐️⭐️⭐️⭐️
    October 24, 2023

    Hi @Diana Chimnaz Johan, did the above help you?

    Seasoned ⭐️⭐️⭐️
    October 24, 2023

    Hello,

    It helped to confirm the limitation of the jupyter notebook and streamlit since both use pyodide. I was wondering if there is a plan to lift that limitation? 

    Thanks,

    Diana

    Murad Sæter
    Practitioner ⭐️⭐️⭐️
    Practitioner ⭐️⭐️⭐️
    October 26, 2023

    We don’t have any plans to deploy jupyter or streamlit outside pyodide in the Cognite platform. 

    What are you trying to do that does not work in pyodide?

    Dilini Fernando
    Expert ⭐️⭐️⭐️⭐️
    Expert ⭐️⭐️⭐️⭐️
    November 9, 2023

    Hi @Diana Chimnaz Johan,

    We are following up to see whether you're satisfied with the responses you've received.

    Best regards,
    Dilini  

    Seasoned ⭐️⭐️⭐️
    November 9, 2023

    Hi Dilni,

    Yes, I got all the answers I needed.

    Thanks,

    Diana

    APSHANKAR Sagar
    Seasoned ⭐️⭐️
    Seasoned ⭐️⭐️
    August 5, 2024

    @Murad Sæter 
    sklearn, pytorch, tensorflow are all very well known data science libraries. None of them have a pure python wheel.

    Unless I am wrong, you can’t use them in CDF Streamlit. Do you agree?

    Neither does numba which is a prerequisite for stumpy which I am trying to use for time series segmentation.

    It would be nice to have these packages work. For example, by letting users choose and operate inside docker containers like on DigitalOcean. Otherwise, many interesting things will have to be done outside of CDF.

    Murad Sæter
    Practitioner ⭐️⭐️⭐️
    Practitioner ⭐️⭐️⭐️
    August 6, 2024

    You are right. There are limitations with pydiode, but we have currently no plans of deploying any server side notebook or streamlit functionality. If you need that you can use any cloud provider and access CDF using our SDKs.