d0c-s4vage / lookatme

An interactive, terminal-based markdown presenter
https://lookatme.readthedocs.io/en/latest/
MIT License
2.06k stars 59 forks source link

Install reports ERROR but it still runs OK #204

Closed laoshaw closed 1 year ago

laoshaw commented 1 year ago

Describe the bug

pip install give error messages:

Defaulting to user installation because normal site-packages is not writeable
Collecting lookatme
  Downloading lookatme-2.5.5-py3-none-any.whl (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.5/42.5 KB 817.2 kB/s eta 0:00:00
Collecting urwid<3,>=2
  Downloading urwid-2.1.2.tar.gz (634 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 634.6/634.6 KB 4.9 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting marshmallow<4,>=3.17.0
  Using cached marshmallow-3.19.0-py3-none-any.whl (49 kB)
Requirement already satisfied: Pygments<3,>=2 in /usr/lib/python3/dist-packages (from lookatme) (2.11.2)
Requirement already satisfied: Click<9,>=7 in /usr/lib/python3/dist-packages (from lookatme) (8.0.3)
Requirement already satisfied: PyYAML<6,>=5 in /usr/lib/python3/dist-packages (from lookatme) (5.4.1)
Collecting mistune<1,>=0.8
  Downloading mistune-0.8.4-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: packaging>=17.0 in /usr/lib/python3/dist-packages (from marshmallow<4,>=3.17.0->lookatme) (21.3)
Building wheels for collected packages: urwid
  Building wheel for urwid (setup.py) ... done
  Created wheel for urwid: filename=urwid-2.1.2-cp310-cp310-linux_x86_64.whl size=255389 sha256=44f2195fc50716425be570ba51fe17b4aed8c7e5a971c156d911eff0681d1d1c
  Stored in directory: /home/misc/.cache/pip/wheels/05/3d/85/cde786c07f333509d868e5024d5ed8c70519fa1b8e8c66ec6c
Successfully built urwid
Installing collected packages: urwid, mistune, marshmallow, lookatme
  Attempting uninstall: mistune
    Found existing installation: mistune 3.0.0rc4
    Uninstalling mistune-3.0.0rc4:
      Successfully uninstalled mistune-3.0.0rc4
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.
present 0.6.0 requires mistune>=2.0.0a4, but you have mistune 0.8.4 which is incompatible.
Successfully installed lookatme-2.5.5 marshmallow-3.19.0 mistune-0.8.4 urwid-2.1.2

To Reproduce

On ubuntu 22.04 which has python 3.10.6 installed by default, run pip install lookatme

Expected behavior Install without errors.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context

Re-run pip install lookatme or pip install --upgrade lookatme returns no errors, as below:

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: lookatme in /home/misc/.local/lib/python3.10/site-packages (2.5.5)
Requirement already satisfied: PyYAML<6,>=5 in /usr/lib/python3/dist-packages (from lookatme) (5.4.1)
Requirement already satisfied: marshmallow<4,>=3.17.0 in /home/misc/.local/lib/python3.10/site-packages (from lookatme) (3.19.0)
Requirement already satisfied: Click<9,>=7 in /usr/lib/python3/dist-packages (from lookatme) (8.0.3)
Requirement already satisfied: mistune<1,>=0.8 in /home/misc/.local/lib/python3.10/site-packages (from lookatme) (0.8.4)
Requirement already satisfied: Pygments<3,>=2 in /usr/lib/python3/dist-packages (from lookatme) (2.11.2)
Requirement already satisfied: urwid<3,>=2 in /home/misc/.local/lib/python3.10/site-packages (from lookatme) (2.1.2)
Requirement already satisfied: packaging>=17.0 in /usr/lib/python3/dist-packages (from marshmallow<4,>=3.17.0->lookatme) (21.3)
d0c-s4vage commented 1 year ago

Ah, interesting. It looks like you're installing lookatme in an environment where other libraries/tools have dependencies on different versions of mistune:

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.
present 0.6.0 requires mistune>=2.0.0a4, but you have mistune 0.8.4 which is incompatible.

The reason why you don't see the error again is because installing lookatme uninstalled the version of mistune that present requires, and installed the one that lookatme requires. When you do the second installation, the conflicting mistune version is no longer installed in the environment.

Version 3.0 of lookatme is getting very close to being released. In that version lookatme will use a different markdown parser, which coincidentally will help you here. If you're keen to check it out, run pip install --pre --upgrade lookatme - this should install the latest release candidate for lookatme. It has some major changes, and may potentially be less stable than the latest 2.X version of lookatme.

Side note: Have you tried tools like pipx to manage virtual environments for specific tools? I've used it for quite a while and really like it - every now and then I run into a quirk though.

d0c-s4vage commented 1 year ago

As there's nothing here that lookatme can do about the mistune version conflict with other tools in your environment, I'm going to close this issue.

Feel free to keep commenting here in case I missed something!