datapane / datapane

Build and share data reports in 100% Python

Home Page:https://datapane.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No module named 'flit.inifile'

ashprice opened this issue · comments

System Information

  • OS: Arch Linux 5.15.8-arch1-1
  • Python version: 3.10.1
  • Python environment: pip
  • Using jupyter: false
  • Datapane version: 0.3.8

Bug / Issue

When running datapane hello-world or running a previously working project involving the datapane library I am getting the following error:

Traceback (most recent call last):
  File "/home/hearth/.local/bin/datapane", line 5, in <module>
    from datapane.__main__ import main
  File "/home/hearth/.local/lib/python3.10/site-packages/datapane/__init__.py", line 2, in <module>
    from .api import (  # noqa: F401
  File "/home/hearth/.local/lib/python3.10/site-packages/datapane/api.py", line 37, in <module>
    from dp_common.scripts.config import DATAPANE_YAML, DatapaneCfg
  File "/home/hearth/.local/lib/python3.10/site-packages/dp_common/scripts/__init__.py", line 2, in <module>
    from .builder import build_local_sdist, build_wheel
  File "/home/hearth/.local/lib/python3.10/site-packages/dp_common/scripts/builder.py", line 15, in <module>
    from flit.inifile import ConfigError, read_flit_config
ModuleNotFoundError: No module named 'flit.inifile'

I have tried reinstalling flit both with my system's package manager, pip, and by cloning the flit git repo; I also played around with the commands used to install from source. I've had a look at builder.py and tried reinstalling stuff with pipenv, but no dice.

Hi @ashprice ,

Thanks for raising this (and apologies for the delay) - I think this may be due to a using an old version of Datapane 0.3.8, when the current is 0.13.2. Can you please try updating your version of the datapane package and trying again?

I have tried updating datapane via pip3, unfortunately I have problems with various packages in the installation proccess, including numpy and some others - it seems to halt installation at these points and then to resort using a different method? There is a lot of console output so I am not sure if I should paste it all. The final block of errors, relating to cython, is this:

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/setup.py'"'"'; __file__='"'"'/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-arr3pyaj/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/vofan/.local/include/python3.10/scikit-learn
         cwd: /tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/
    Complete output (21 lines):
    Partial import of sklearn during the build process.
    Traceback (most recent call last):
      File "/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/sklearn/_build_utils/__init__.py", line 32, in _check_cython_version
        import Cython
    ModuleNotFoundError: No module named 'Cython'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/setup.py", line 303, in <module>
        setup_package()
      File "/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/setup.py", line 299, in setup_package
        setup(**metadata)
      File "/usr/lib/python3.10/site-packages/numpy/distutils/core.py", line 135, in setup
        config = configuration()
      File "/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/setup.py", line 180, in configuration
        _check_cython_version()
      File "/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/sklearn/_build_utils/__init__.py", line 35, in _check_cython_version
        raise ModuleNotFoundError(message)
    ModuleNotFoundError: Please install Cython with a version >= 0.28.5 in order to build a scikit-learn from source.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/setup.py'"'"'; __file__='"'"'/tmp/pip-install-00l8qjr7/scikit-learn_63e30236fb8741dc9342861587a0f0bf/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-arr3pyaj/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/vofan/.local/include/python3.10/scikit-learn Check the logs for full command
output.

I've been trying to install an older version of Cython without much luck. Still, I suppose this is a scikit-learn/numpy/etc related issue and not strictly to do with datapane. I will try to figure it out later today.