Skip to main content
Seasoned ⭐️⭐️⭐️
Oct 12, 2023 6:17 PM UTC
Solved

Python with puodide

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?

    Murad Sæter
    Practitioner ⭐️⭐️⭐️
    Oct 13, 2023 9:01 AM UTC

    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 ⭐️⭐️⭐️
    Oct 13, 2023 9:01 AM UTC

    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 ⭐️⭐️⭐️⭐️
    Oct 24, 2023 5:29 AM UTC

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

    Seasoned ⭐️⭐️⭐️
    Oct 24, 2023 7:14 PM UTC

    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 ⭐️⭐️⭐️
    Oct 26, 2023 7:24 AM UTC

    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 ⭐️⭐️⭐️⭐️
    Nov 9, 2023 7:50 AM UTC

    Hi @Diana Chimnaz Johan,

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

    Best regards,
    Dilini  

    Seasoned ⭐️⭐️⭐️
    Nov 9, 2023 1:54 PM UTC

    Hi Dilni,

    Yes, I got all the answers I needed.

    Thanks,

    Diana

    APSHANKAR Sagar
    Seasoned ⭐️⭐️
    Seasoned ⭐️⭐️
    Aug 5, 2024 2:45 PM UTC

    @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 ⭐️⭐️⭐️
    Aug 6, 2024 6:56 AM UTC

    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.