mkrphys / ipython-tikzmagic

IPython magics for generating figures with TikZ
BSD 3-Clause "New" or "Revised" License
159 stars 43 forks source link

Google Colab install via pip fails #41

Open usmandroid opened 1 year ago

usmandroid commented 1 year ago

INPUT !pip install --upgrade pip !pip install git+git://github.com/mkrphys/ipython-tikzmagic.git %load_ext tikzmagic OUTPUT

fails with the following error:

WARNING: Discarding git+git://github.com/mkrphys/ipython-tikzmagic.git. Command errored out with exit status 128: git clone -q git://github.com/mkrphys/ipython-tikzmagic.git /tmp/pip-req-build-i8kbszvw Check the logs for full command output. ERROR: Command errored out with exit status 128: git clone -q git://github.com/mkrphys/ipython-tikzmagic.git /tmp/pip-req-build-i8kbszvw Check the logs for full command output.

ModuleNotFoundError Traceback (most recent call last) in 2 # https://github.com/mkrphys/ipython-tikzmagic 3 get_ipython().system('pip install git+git://github.com/mkrphys/ipython-tikzmagic.git') ----> 4 get_ipython().run_line_magic('load_ext', 'tikzmagic')

Solved by downloading the repo first and installing it manually: SOLUTION:

!git clone https://github.com/mkrphys/ipython-tikzmagic.git !pip install -e /content/ipython-tikzmagic/

HeroCC commented 1 year ago

Try using the following command instead:

pip install git+https://github.com/mkrphys/ipython-tikzmagic.git

This error is probably related to GitHub deprecating the git:// protocol

dboeckenhoff commented 1 year ago

@herocc I propose, you update the docs for that. Had the same issue.

kpobrien commented 11 months ago

As of 2023-10-23, the following commands work to run ipython-tikzmagic on Google Colab:

!apt update
!apt install imagemagick
!apt install pdf2svg
!apt install texlive texlive-latex-extra
!pip install git+https://github.com/mkrphys/ipython-tikzmagic.git
!sed --in-place --quiet 's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read|write" pattern="PDF"/g' /etc/ImageMagick-6/policy.xml
%load_ext tikzmagic

where the apt install commands are from here and the the sed command is necessary to fix the ImageMagick permissions issue identified here.