# Problems with TikzGraphs.jl

**URL:** <https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251>\
**Category:** General Usage\
**Created:** [January 25, 2026, 1:58am UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251 "2026-01-25T01:58:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Post date:** [January 25, 2026, 1:58am UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251/1 "2026-01-25T01:58:54Z")

</div>

I installed the [TikzGraphs.jl](https://github.com/JuliaTeX/TikzGraphs.jl/blob/master/doc/TikzGraphs.ipynb) package, and tried to execute the simple sample code provided

```julia-auto
using TikzGraphs
using Graphs
g = DiGraph(4)
add_edge!(g, 1, 2)
add_edge!(g, 2, 3)
TikzGraphs.plot(g)

```

However I keep getting this error :

```julia-auto
ERROR: MethodError: no method matching plot(::SimpleDiGraph{Int64})
Closest candidates are:
  plot(::Any, ::TikzGraphs.Layouts.Layout) at ~/.julia/packages/TikzGraphs/d963V/src/TikzGraphs.jl:44
  plot(::Any, ::TikzGraphs.Layouts.Layout, ::Vector{T}; args...) where T<:AbstractString at ~/.julia/packages/TikzGraphs/d963V/src/TikzGraphs.jl:44
  plot(::Any, ::Vector{T}; args...) where T<:AbstractString at ~/.julia/packages/TikzGraphs/d963V/src/TikzGraphs.jl:45
  ...
Stacktrace:
 [1] top-level scope
   @ REPL[6]:1

```

I would appreciate any help with fixing this issue. My Julia version is 1.8.5.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [January 25, 2026, 9:27am UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251/2 "2026-01-25T09:27:05Z")

</div>

Try plotting another type of graph (not a digraph) - this might help narrow down the issue.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [January 25, 2026, 11:32am UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251/3 "2026-01-25T11:32:29Z")

</div>

For some reason you are running an old version of `TikzGraphs` which only works with graphs from the (deprecated) `LightGraphs` package. This is possibly caused by adding all packages to your global environment and you have something in there which holds you back to old versions of certain packages, due to compatibility constraints.

If you use a clean environment, e.g. by doing `pkg> activate --temp` before adding `Graphs` and `TikzGraphs`, the example code should work.

---

<div class="post-metadata">

**Author:** ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Post date:** [January 25, 2026, 12:12pm UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251/4 "2026-01-25T12:12:08Z")

</div>

> [@iamsuddhasattwa](#):
>
> ```julia-auto
> using TikzGraphs
> using Graphs
> g = DiGraph(4)
> add_edge!(g, 1, 2)
> add_edge!(g, 2, 3)
> TikzGraphs.plot(g)
> 
> ```

Thank you for the suggestion. However I tried that and it did not seem to work

```julia-auto
(@v1.8) pkg> activate --temp
  Activating new project at `/tmp/jl_blPgHn`

julia> using TikzGraphs
[Info: Precompiling TikzGraphs [b4f28e30-c73f-5eaf-a395-8a9db949a742]
WARNING: could not import LaTeXStrings.@L_mstr into TikzPictures

julia> using Graphs

julia> g = DiGraph(4)
{4, 0} directed simple Int64 graph

julia> add_edge!(g, 1, 2)
true

julia> add_edge!(g, 2, 3)
true

julia> TikzGraphs.plot(g)
ERROR: MethodError: no method matching plot(::SimpleDiGraph{Int64})
Closest candidates are:
  plot(::Any, ::TikzGraphs.Layouts.Layout) at ~/.julia/packages/TikzGraphs/d963V/src/TikzGraphs.jl:44
  plot(::Any, ::TikzGraphs.Layouts.Layout, ::Vector{T}; args...) where T<:AbstractString at ~/.julia/packages/TikzGraphs/d963V/src/TikzGraphs.jl:44
  plot(::Any, ::Vector{T}; args...) where T<:AbstractString at ~/.julia/packages/TikzGraphs/d963V/src/TikzGraphs.jl:45
  ...
Stacktrace:
 [1] top-level scope
   @ REPL[7]:1

```

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [January 25, 2026, 1:00pm UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251/5 "2026-01-25T13:00:06Z")

</div>

You need to do that in a new session where you haven’t already loaded some earlier version of the package _and_ you have to add the packages to the temporary environment; otherwise they will still be loaded from your global environment.

```julia-auto
(@v1.8) pkg> activate --temp
  Activating new project at `/tmp/jl_IMaM4M`

(jl_IMaM4M) pkg> add Graphs TikzGraphs
    Updating registry at `~/.julia/registries/General`
   Resolving package versions...
    Updating `/tmp/jl_IMaM4M/Project.toml`
⌅ [86223c79] + Graphs v1.12.1
  [b4f28e30] + TikzGraphs v1.4.0
...

```

---

<div class="post-metadata">

**Author:** ![iamsuddhasattwa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iamsuddhasattwa/32/7441_2.png) [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Post date:** [January 25, 2026, 1:48pm UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251/6 "2026-01-25T13:48:45Z")

</div>

Thank you very much, this worked.  
In the process I also learnt that packages can have conflicts. It seems to me that `LightGraphs` is the offender. To avoid having to load a temporary workspace every time and installing packages, is there any way I can remove `LightGraphs` ? Or do I need to re-install Julia ?

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [January 25, 2026, 2:03pm UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251/7 "2026-01-25T14:03:29Z")

</div>

Have you tried

```julia-auto
pkg> remove LightGraphs

```
