Discussion:
[julia-users] Deprecation of require
Eduardo Lenz
2015-07-23 18:58:58 UTC
Permalink
Hi
I just downloaded the last nightly build and I am receiving a new
deprecation message:

Warning, "require" is deprecated, use "using" or "import" instead.

My question is: I am using "require" due to the need to automatically
import these functions for all workers in a cluster. As long as I know, to
accomplish this task I have to use "require" and also provide the correct
path of the corresponding .jl files. How can I do this same thing using
"using" or "import" ? I tried to use it as I was using "require" and it is
not working as expected.

Thanks for your help and sorry for the dumb question.
Tim Holy
2015-07-31 11:30:37 UTC
Permalink
If MyModule.jl is on your LOAD_PATH,

@everywhere import MyModule

should work. You can add

push!(LOAD_PATH,"/my/code/repository")

to your .juliarc.jl file.

This has been deprecated because of precompilation; it was felt that the
string version left it too ambiguous about whether you wanted to load the raw
file or the cached version.

Best,
--Tim
Post by Eduardo Lenz
Hi
I just downloaded the last nightly build and I am receiving a new
Warning, "require" is deprecated, use "using" or "import" instead.
My question is: I am using "require" due to the need to automatically
import these functions for all workers in a cluster. As long as I know, to
accomplish this task I have to use "require" and also provide the correct
path of the corresponding .jl files. How can I do this same thing using
"using" or "import" ? I tried to use it as I was using "require" and it is
not working as expected.
Thanks for your help and sorry for the dumb question.
Eduardo Lenz
2015-07-31 14:23:23 UTC
Permalink
Thanks for your help Tim !
Post by Tim Holy
If MyModule.jl is on your LOAD_PATH,
@everywhere import MyModule
should work. You can add
push!(LOAD_PATH,"/my/code/repository")
to your .juliarc.jl file.
This has been deprecated because of precompilation; it was felt that the
string version left it too ambiguous about whether you wanted to load the raw
file or the cached version.
Best,
--Tim
Post by Eduardo Lenz
Hi
I just downloaded the last nightly build and I am receiving a new
Warning, "require" is deprecated, use "using" or "import" instead.
My question is: I am using "require" due to the need to automatically
import these functions for all workers in a cluster. As long as I know,
to
Post by Eduardo Lenz
accomplish this task I have to use "require" and also provide the
correct
Post by Eduardo Lenz
path of the corresponding .jl files. How can I do this same thing using
"using" or "import" ? I tried to use it as I was using "require" and it
is
Post by Eduardo Lenz
not working as expected.
Thanks for your help and sorry for the dumb question.
Continue reading on narkive:
Loading...