@drawsvg is missing from the Luxor package

If I execute the code below (uncommented) in VS Code, ERROR: LoadError: UndefVarError: @drawsvg not defined. As is, it prints:
@draw
@eps
@imagematrix
@imagematrix!
@layer
@pdf
@png
@polar
@setcolor_str
@svg

using Luxor
n=names(Luxor)
#=
@drawsvg begin
	for _ in 1:10
		circle(O, 3, :fill)
		# new coordinates
		translate(70 * rand() - 35, 70 * rand() - 35)
		rotate(2 * pi * rand())
end 200 200
=#
for n in names(Luxor)
    if string(n)[1] == '@'
    println(n)
    end
end

The drawing code was posted here in January. Please, what am I missing?

what version of Luxor are you using and what if you use

Luxor.@drawsvg

https://juliagraphics.github.io/Luxor.jl/dev/reference/api/#Luxor.@drawsvg

[ae8d54c2] Luxor v2.11.0
It does not help to use “Luxor.@drawsvg” instead of “@drawsvg”.

You’re about 2 years behind - time to upgrade to 3.7 :grinning:

2 Likes

@cormullion
Thanks or that, but I guess I don’t know how to do that. I did “up Luxor” to get what I have. BTW, will this work then?

What about the Julia version? Also, sometimes a package will be “held back” and not upgraded if it would otherwise break your current environment, so you might be out of date elsewhere…

@cormullion Julia 1.8.5. I have just updated and the error is gone. Thank you.

@cormullion: Since I had just installed Julia recently, I couldn’t understand how my Luxor was 2 years behind. One of the things I had done along the way was to follow instructions from the book “Think Julia”: “A convenience package is provided that can be directly added to Julia. Just type add https://github.com/BenLauwens/ThinkJulia.jl in the REPL in Pkg mode,…” I didn’t have much success with that and moved on to another book, " Interactive Visualization and Plotting with Julia".

To the point, I tried the “convenience” today and Luxor 3.7 was replaced by Luxor 1.12.0. Updating didn’t change it. I removed ThinkJulia and reran update to get back to Luxor 3.7.0. I have no idea how I got to Luxor 2.11.0 above, but I suppose something similar occurred. Not curious, so no question. Thanks again for your help.

Yes, once upon a time, ThinkJulia.jl was shiny and new, and integrated Luxor as a simple turtle-graphics component. But time has passed and ThinkJulia.jl has been neglected for over three years, now. Although much of it should still be useful, there will be some versioning issues to be addressed: typically, you’d set up an environment for working with a set of older packages, and a different environment when you want to use more recent versions. The package manager is designed to allow this.

@Cormullion: I had thought of trying that, but I’m plodding through the Luxor at the moment. And, the book is still useful in many respects. Thanks.