ThinkJulia.jl
ThinkJulia.jl copied to clipboard
Problem with Chapter 14 Modules in Julia 1.1
I am using Julia 1.1 in Ubuntu 18.04 and was doing the Exercise 14-1 of the Modules Section in chapter 14.
Executing the code:
include("wc.jl")
using LineCount
linecount("wc.jl")
gives the error:
ArgumentError: Package LineCount not found in current path:
- Run `import Pkg; Pkg.add("LineCount")` to install the LineCount package.
Stacktrace:
[1] require(::Module, ::Symbol) at ./loading.jl:823
[2] top-level scope at In[1]:2
In https://stackoverflow.com/questions/37200025/how-to-import-custom-module-in-julia says that in >0.7 you should use:
include("wc.jl")
using .LineCount
linecount("wc.jl")
that runs with no problem.
Thanks for your work in this great book, Daniel Palma
Thanks