JunoLab / Weave.jl

Scientific reports/literate programming for Julia
http://weavejl.mpastell.com
MIT License
824 stars 95 forks source link

ERROR: UndefVarError occurred, including output in Weaved document #336

Closed likanzhan closed 4 years ago

likanzhan commented 4 years ago

description

I have a simple mm.jmd file containing only one line of Julia code:

```julia
versioninfo()

But when I tried to weave the document with

weave("MM.jmd")


I got the following error

┌ Info: Weaving chunk 1 from line 1 └ progress = 0.0 ┌ Warning: ERROR: UndefVarError occurred, including output in Weaved document └ @ Weave ~/.julia/packages/Weave/74s70/src/run.jl:248 ┌ Info: Weaved all chunks └ progress = 1 [ Info: Report weaved to MM.html "/Users/lzhan/MM.html"


What could be the reason for this? 

Thanks,
Likan

## versions

> `using InteractiveUtils; versioninfo()`:
<!-- please paste the the output of `using InteractiveUtils; versioninfo()` in the backticks below -->
```julia
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i7-4960HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, haswell)

using Pkg; Pkg.status():

Status `~/.julia/environments/v1.4/Project.toml`
[44d3d7a6] Weave v0.10.0 #master (https://github.com/JunoLab/Weave.jl.git)
aviatesk commented 4 years ago

since versioninfo is exported by InteractiveUtils , you need to do using InteractiveUtils in the document unless you weave(hoge; mod = Main) in REPL (InteractiveUtils is loaded into Main by default in REPL).