Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgs on windows #23

Closed
arhi opened this issue Mar 10, 2021 · 7 comments
Closed

libgs on windows #23

arhi opened this issue Mar 10, 2021 · 7 comments
Labels
bug - installation Installation from PyPi fails or something is weird with it ToDo solution known, but not implemented yet

Comments

@arhi
Copy link

arhi commented Mar 10, 2021

libgs is requred for latex2svg feature in the project. I'm unable to make libgs work on windows10 neither with 3.8 nor 3.9 python.

PS D:\dev\xxx\documentGenerator>  .\venv\Scripts\python.exe -m pip install libgs
Collecting libgs
  Using cached libgs-1.2.1.tar.gz (123 kB)
Collecting libgs_ops
  Using cached libgs_ops-1.1.tar.gz (56 kB)
Collecting pandas==0.21.0
  Using cached pandas-0.21.0.tar.gz (11.3 MB)
  Installing build dependencies ... |
...
building with VS2019 
...
WARNING: Discarding https://files.pythonhosted.org/packages/84/4c/622301f99725c6da76ae8079cb6b9091d9098098bd6b4eac47fb502b32f4/pandas-0.21.0.tar.gz#sha256=5cd5cb30e72eeaf202f0e5e180780b897570e889d2db328c689a5a263405c559 (from https://pypi.org/simple/pandas/). Command errored out with exit status 1: 'D:\dev\xxx\documentGenerator\venv\Scripts\python.exe' 'D:\dev\xxx\documentGenerator\venv\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\arhimed\AppData\Local\Temp\pip-build-env-bf3xyk8l\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel setuptools Cython 'numpy==1.9.3; python_version=='"'"'3.5'"'"'' 'numpy==1.12.1; python_version=='"'"'3.6'"'"'' 'numpy==1.13.1; python_version>='"'"'3.7'"'"'' Check the logs for full command output.
Collecting libgs
  Using cached libgs-1.1.tar.gz (270 kB)
  Using cached libgs-0.11.tar.gz (272 kB)
ERROR: Cannot install libgs==0.11, libgs==1.1 and libgs==1.2.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    libgs 1.2.1 depends on pandas==0.21.0
    libgs 1.1 depends on pandas==0.21.0
    libgs 0.11 depends on pandas==0.21.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
PS D:\dev\xxx\documentGenerator>

With python 3.6 I can make libgs compile and install but project complain libgs is not found?!

PS D:\dev\xxx\documentGenerator> .\venv\Scripts\python.exe -m pip install libgs
Requirement already satisfied: libgs in d:\dev\xxx\documentgenerator\venv\lib\site-packages (1.2.1)
Requirement already satisfied: libgs_ops in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (1.1)
Requirement already satisfied: pandas==0.21.0 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (0.21.0)
Requirement already satisfied: numpy==1.13.3 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (1.13.3)
Requirement already satisfied: ephem==3.7.6.0 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (3.7.6.0)
Requirement already satisfied: tornado<5 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (4.5.3)
Requirement already satisfied: bokeh==0.12.6 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (0.12.6)
Requirement already satisfied: Flask==0.12.2 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (0.12.2)
Requirement already satisfied: angles==2.0 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (2.0)
Requirement already satisfied: pyzmq==16.0.2 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (16.0.2)
Requirement already satisfied: SQLAlchemy>1.2 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (1.3.23)
Requirement already satisfied: xmltodict in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (0.12.0)
Requirement already satisfied: lxml in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (4.6.2)
Requirement already satisfied: pymysql in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (1.0.2)
Requirement already satisfied: pyserial in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from libgs) (3.5)
Requirement already satisfied: six>=1.5.2 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from bokeh==0.12.6->libgs) (1.15.0)
Requirement already satisfied: requests>=1.2.3 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from bokeh==0.12.6->libgs) (2.25.1)
Requirement already satisfied: PyYAML>=3.10 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from bokeh==0.12.6->libgs) (5.4.1)
Requirement already satisfied: python-dateutil>=2.1 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from bokeh==0.12.6->libgs) (2.8.1)
Requirement already satisfied: Jinja2>=2.7 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from bokeh==0.12.6->libgs) (2.11.3)
Requirement already satisfied: bkcharts>=0.2 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from bokeh==0.12.6->libgs) (0.2)
Requirement already satisfied: Werkzeug>=0.7 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from Flask==0.12.2->libgs) (1.0.1)
Requirement already satisfied: click>=2.0 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from Flask==0.12.2->libgs) (7.1.2)
Requirement already satisfied: itsdangerous>=0.21 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from Flask==0.12.2->libgs) (1.1.0)
Requirement already satisfied: pytz>=2011k in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from pandas==0.21.0->libgs) (2021.1)
Requirement already satisfied: MarkupSafe>=0.23 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from Jinja2>=2.7->bokeh==0.12.6->libgs) (1.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from requests>=1.2.3->bokeh==0.12.6->libgs) (1.26.3)
Requirement already satisfied: certifi>=2017.4.17 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from requests>=1.2.3->bokeh==0.12.6->libgs) (2020.12.5)
Requirement already satisfied: idna<3,>=2.5 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from requests>=1.2.3->bokeh==0.12.6->libgs) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in d:\dev\xxx\documentgenerator\venv\lib\site-packages (from requests>=1.2.3->bokeh==0.12.6->libgs) (4.0.0)
PS D:\dev\xxx\documentGenerator>
PS D:\dev\xxx\documentGenerator>
PS D:\dev\xxx\documentGenerator> .\venv\Scripts\python.exe -m gh_md_to_html -h
Warning: libgs not found

thanks

@phseiff
Copy link
Owner

phseiff commented Apr 3, 2021

Hello @arhi, and sorry for my late response. I accidentally unwatched my own repository, and didn't realize this until right now (three months later), so I missed several issues in the process.

I didn't really test the project on Windows, simply because I do not use Windows myself and assumed testing on my local system would suffice. I will look into this issue this evening, and see if I can fix it.

Thanks for raising this issue, and sorry for my late response again!

@phseiff phseiff added the bug - installation Installation from PyPi fails or something is weird with it label Apr 3, 2021
@phseiff
Copy link
Owner

phseiff commented Apr 3, 2021

With python 3.6 I can make libgs compile and install but project complain libgs is not found?!

Does it crash, though, or just ignore this warning and continue running?

libgs is requred for latex2svg feature in the project. I'm unable to make libgs work on windows10 neither with 3.8 nor 3.9 python.

Could you outline what happens when it isn't present? I don't have Windows, so I can not test that, and the logs you provided only show what happens when you try to install libgs using pip3, but no actual error that not having libgs results in.
From looking at the code, my assumption is that not having libgs does nothing but create a warning, so my bet is that muting the warning, unless latex2svg is actually used to convert some formulas (so the warning isn't displayed anymore when running gh-md-to-html -h anymore, for example) would be the best way to fix this problem - unless I misunderstood the problem and there are actually crashes or invalid outputs happening due to libgs missing?

@arhi
Copy link
Author

arhi commented Apr 4, 2021

Hi, no worries, happens to everyone..

Does it crash, though, or just ignore this warning and continue running?

no crash, there's a message that libgs is not present and that's about it, it does what it's supposed to do (I'm not using latex)

D:\dev\xxx\src>python -m venv venv

D:\dev\xxx\src>.\venv\Scripts\python.exe -m pip install gh_md_to_html
Collecting gh_md_to_html
  Downloading gh_md_to_html-1.7.2-py3-none-any.whl (53 kB)
     |████████████████████████████████| 53 kB 1.3 MB/s
Collecting Pillow>=8.0.1
  Downloading Pillow-8.2.0-cp38-cp38-win_amd64.whl (2.2 MB)
     |████████████████████████████████| 2.2 MB 3.3 MB/s
Requirement already satisfied: setuptools in d:\dev\xxx\src\venv\lib\site-packages (from gh_md_to_html) (49.2.1)
Collecting requests
  Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Collecting webcolors
  Using cached webcolors-1.11.1-py3-none-any.whl (9.9 kB)
Collecting shellescape
  Using cached shellescape-3.8.1-py2.py3-none-any.whl (3.1 kB)
Collecting beautifulsoup4
  Using cached beautifulsoup4-4.9.3-py3-none-any.whl (115 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
     |████████████████████████████████| 153 kB ...
Collecting idna<3,>=2.5
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting chardet<5,>=3.0.2
  Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Collecting soupsieve>1.2; python_version >= "3.0"
  Downloading soupsieve-2.2.1-py3-none-any.whl (33 kB)
Installing collected packages: Pillow, certifi, urllib3, idna, chardet, requests, webcolors, shellescape, soupsieve, beautifulsoup4, gh-md-to-html
Successfully installed Pillow-8.2.0 beautifulsoup4-4.9.3 certifi-2020.12.5 chardet-4.0.0 gh-md-to-html-1.7.2 idna-2.10 requests-2.25.1 shellescape-3.8.1 soupsieve-2.2.1 urllib3-1.26.4 webcolors-1.11.1

src>.\venv\Scripts\python.exe --version
Python 3.8.8

src>.\venv\Scripts\python.exe -m gh_md_to_html Documentation.md
Warning: libgs not found
C:\Python38\lib\runpy.py:127: RuntimeWarning: 'gh_md_to_html.__main__' found in sys.modules after import of package 'gh_md_to_html', but prior to execution of 'gh_md_to_html.__main__'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))

src>dir Documentation.html
 Volume in drive D is SSD RADNI
 Volume Serial Number is D642-911C

 Directory of src

Sun, 04/04/2021  05:15 AM             2,965 Documentation.html
               1 File(s)          2,965 bytes
               0 Dir(s)  295,695,409,152 bytes free


unless I misunderstood the problem and there are actually crashes or invalid outputs happening due to libgs missing?

no crashes, there's only a warning and I assume latex2svg is not working (did not try).

@arhi
Copy link
Author

arhi commented Apr 4, 2021

with 3.8 I can't install libgs at all, but with 3.6 libgs does install but this project still states that libgs is not present, that's confusing

@phseiff
Copy link
Owner

phseiff commented Apr 4, 2021

no crashes, there's only a warning and I assume latex2svg is not working (did not try).

gh-md-to-html always tests whether the latex2svg feature works locally, with all dependencies being installed, by running it on a test formula once. If, for some reason, the test run fails (due to not all dependencies being present), gh-md-to-html uses an online API to convert the latex-formulas to svg. So missing any dependency should, by default, never result in a crash whilst rendering formulas.

I investigated some more into the reason libgs is used by latex2svg, and it turns out it isn't actually needed for our purpose.
Generally, latex2svg writes every formula into a separate .tex-file, converts this .tex-file to .dvi using the local LaTeX installation, and then converts this .dvi-file to a .svg-file using dvisvgm. dvisvgm has libgs as an optional dependency, but only needs it when the .dvi-file it converts to .svg contains PostScript. Since PostScript isn't even allowed in LaTeX formulas, having libgs installed doesn't really do anything when it comes to gh-md-to-html's formula rendering.

with 3.8 I can't install libgs at all, but with 3.6 libgs does install but this project still states that libgs is not present, that's confusing

I will remove the warning that libgs isn't present, then, since libgs turned out to not even be needed 👍

@phseiff phseiff added the ToDo solution known, but not implemented yet label Apr 4, 2021
@phseiff phseiff closed this as completed in 25d9c0f Apr 8, 2021
@phseiff
Copy link
Owner

phseiff commented Apr 8, 2021

@arhi I removed the warning in v1.7.3 now; you should be able to do pip3 install --upgrade gh-md-to-html>=1.7.3 (or however it looks when done in the Windows shell) now to get rid of the nasty warning every time you run the tool.

@arhi
Copy link
Author

arhi commented Apr 8, 2021

thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - installation Installation from PyPi fails or something is weird with it ToDo solution known, but not implemented yet
Projects
None yet
Development

No branches or pull requests

2 participants