Search code examples
pythongoogle-colaboratoryopenmodelicapyfmi

subprocess error when installing PyFMI on Google Colab


I'm new to Google Colab and Python, but I'm trying to use Google Colab to run some tests to have an executable to load and run a FMU I did on OpenModelica.

I'm using Google Colab as I thought it would be easier. However, I get an error whnen when trying to install PyFMI


> . !pip install pyfmi

> Collecting pyfmi
  Downloading PyFMI-2.5.tar.gz (4.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.8/4.8 MB 41.0 MB/s eta 0:00:00
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Any idea on why this is happening and how can I fix it?

Thank you in advance!


Solution

  • The last version of PyFMI on PyPI has been released in 2018, and only has wheels for Pythons 2.7, 3.5 and 3.6.

    However, it looks like development is still active on GitHub, and there are new versions of these packages, pre-compiled. They just aren't able to update it on PyPI right now.

    If your Colab environment is running Python 3.8, you should be able to install these versions of the packages with

    pip install https://github.com/modelon-community/Assimulo/releases/download/Assimulo-3.4.3/Assimulo-3.4.3-cp38-cp38-linux_x86_64.whl
    pip install https://github.com/modelon-community/PyFMI/releases/download/PyFMI-2.11.0/PyFMI-2.11.0-cp38-cp38-linux_x86_64.whl