cmhughes / latexindent.pl

Perl script to add indentation (leading horizontal space) to LaTeX files. It can modify line breaks before, during and after code blocks; it can perform text wrapping and paragraph line break removal. It can also perform string-based and regex-based substitutions/replacements. The script is customisable through its YAML interface.
GNU General Public License v3.0
884 stars 84 forks source link

UnsatisfiableError when installing #366

Closed eZSnake closed 2 years ago

eZSnake commented 2 years ago

Please provide the following when posting an issue:

original .tex code

I didn't get to testing any .tex files as the install appears to have a problem on my end

yaml settings

Templated used from https://gist.github.com/julian-west/e50b25a9aa10551e3452f5a6cfaa6aa3

To use: pre-commit run -a Or: pre-commit install # (runs every time you commit in git) To update this file: pre-commit autoupdate See https://github.com/pre-commit/pre-commit

repos: Run latexindent.pl (get dependencies using Conda)

Standard hooks

Black, the code formatter, natively supports pre-commit

Sort your imports in a standard form

Upgrade older Python syntax

Changes tabs to spaces

actual/given output

Copy pasted from cmd

An unexpected error has occurred: CalledProcessError: command: ('C:\Users\rehwa\anaconda3\condabin\conda.BAT', 'env', 'create', '-p', 'C:\Users\rehwa\.cache\pre-commit\repo2tqqmb5r\conda-default', '--file', 'environment.yml') return code: 1 expected return code: 0 stdout: Collecting package metadata (repodata.json): ...working... done Solving environment: ...working... Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed Solving environment: ...working... Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed

stderr:

UnsatisfiableError:

desired or expected output

I want it to have a successful install instead of crashing

anything else

I tried downloading latexindent through Anaconda Navigator but it kept on giving me 'UnsatisfiableError' so I tried it through a command prompt which ended up giving me the same error (error message is pasted above)

eZSnake commented 2 years ago

A direct install attempt through the console results in this:

Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: / Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed

UnsatisfiableError:

cmhughes commented 2 years ago

I'm finding your original post hard to read. Can you edit it so that it is formatted consistently?

eZSnake commented 2 years ago

It should now have more consistent formatting

cmhughes commented 2 years ago

Thanks for editing.

So this is about pre-commit and conda...? Is your pre-commit yaml file minimal? Please strip it down to the minimum possible.

tdegeus commented 2 years ago

@eZSnake I have a hard time understanding what might go wrong. The installation though pre-commit, and your second post "a direct install" seem to suggest that your conda is somehow unhappy of getting on of the dependencies of latexindent.pl. What is crucially missing in you post is therefore: on which platform are you working?

To debug, I would suggest that you try to install the dependencies of latexindent.pl one by one so see which one is the blocker. So please try in an active environment:

conda install -c conda-forge perl
conda install -c conda-forge perl-file-homedir
conda install -c conda-forge perl-yaml-tiny
conda install -c conda-forge latexindent.pl

Furthermore, I would suggest the same as @cmhughes : make a .pre-commit-config.yaml with only latexindent.pl to try (and remove everything that is not needed from the post above).

As a work-around you could try to use latexindent.pl instead of latexindent-conda in your .pre-commit-config.yaml

eZSnake commented 2 years ago

I tried creating a new environment in Conda and just installing latexindent as the only package using the conda install commands and it installed perl just fine but I once again got the UnsatisfiableError when trying to install perl-file-homedir

conda install -c conda-forge perl-yaml-tiny Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: | Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed

UnsatisfiableError:

The same messages popped up when I tried to install perl-yaml-tiny

cmhughes commented 2 years ago

It seems that this is really a conda installation issue and not specific to latexindent....?

I came across the following which looks like it had some tips: https://github.com/merenlab/anvio/issues/1145

tdegeus commented 2 years ago

Your post is inconsistent. What is the first (only?) package of the three dependencies there that does not work? What platform are you working on?

cmhughes commented 2 years ago

Summary of things we need from you, @eZSnake

  1. minimal YAML
  2. confirmation of the platform you're working on
  3. confirmation of the output from following the steps that @tdegeus has given
cmhughes commented 2 years ago

Closing for now, let us know if you can provide any further information.