alexandrainst / alexandra-ml-template

Template for Python-based data science projects in the Alexandra Institute.
https://alexandra.dk/
MIT License
8 stars 1 forks source link

ImportError: cannot import name 'Application' from 'cleo' #1

Closed oliverkinch closed 1 year ago

oliverkinch commented 1 year ago

Eksempel på hvordan jeg har brugt template (på Black Knight), og fejlen jeg løber ind i når jeg kører make install

Jeg kører først cookiecutter -f gh:alexandrainst/alexandra-ml-template, og giver derefter inputs til de ønskede punkter:

Når jeg kører make install, så får jeg nedenstående fejl.

Installing the 'test_project' project... Traceback (most recent call last): File "/home/oliver_kinch/.local/bin/poetry", line 5, in <module> from poetry.console.application import main File "/usr/lib/python3/dist-packages/poetry/console/__init__.py", line 1, in <module> from .application import Application File "/usr/lib/python3/dist-packages/poetry/console/application.py", line 3, in <module> from cleo import Application as BaseApplication ImportError: cannot import name 'Application' from 'cleo' (/home/oliver_kinch/.local/lib/python3.10/site-packages/cleo/__init__.py) ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pipx 1.0.0 requires argcomplete>=1.9.4, but you have argcomplete 1.8.1 which is incompatible. clikit 0.6.2 requires crashtest<0.4.0,>=0.3.0, but you have crashtest 0.4.1 which is incompatible. Installed Poetry. Traceback (most recent call last): File "/home/oliver_kinch/.local/bin/poetry", line 5, in <module> from poetry.console.application import main File "/usr/lib/python3/dist-packages/poetry/console/__init__.py", line 1, in <module> from .application import Application File "/usr/lib/python3/dist-packages/poetry/console/application.py", line 3, in <module> from cleo import Application as BaseApplication ImportError: cannot import name 'Application' from 'cleo' (/home/oliver_kinch/.local/lib/python3.10/site-packages/cleo/__init__.py) make[1]: *** [makefile:54: setup-poetry] Error 1 Traceback (most recent call last): File "/home/oliver_kinch/.local/bin/poetry", line 5, in <module> from poetry.console.application import main File "/usr/lib/python3/dist-packages/poetry/console/__init__.py", line 1, in <module> from .application import Application File "/usr/lib/python3/dist-packages/poetry/console/application.py", line 3, in <module> from cleo import Application as BaseApplication ImportError: cannot import name 'Application' from 'cleo' (/home/oliver_kinch/.local/lib/python3.10/site-packages/cleo/__init__.py) make[1]: *** [makefile:57: setup-environment-variables] Error 1 hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name> Initialized empty Git repository in /home/oliver_kinch/test_project/.git/ make[1]: *** [makefile:64: setup-git] Error 1 Installed the 'test_project' project.

saattrupdan commented 1 year ago

Tak!

Det ser ud til at være beskrevet i det her issue, og det virker som om, at det har noget at gøre med din poetry installation at gøre, særligt hvis du har installeret den med homebrew. Kan du prøve at køre følgende?

brew uninstall poetry
python3 -m pip uninstall -y poetry poetry-core poetry-plugin-export
brew install pipx
pipx install --force poetry==1.5.1

Hvis det virker, så får jeg det lige integreret ind i make install 🙂

oliverkinch commented 1 year ago

Har ikke prøvet med brew, da jeg kun har testet det på Black Knight.

Men jeg får ikke fejlen mere, efter at jeg har kørt:

python3 -m pip uninstall -y poetry poetry-core poetry-plugin-export
pipx install --force poetry==1.5.1
saattrupdan commented 1 year ago

Ah, fik ikke lige læst at det var på blackknight. Men super!