# Supressing banner from a package

**URL:** https://discourse.julialang.org/t/supressing-banner-from-a-package/60321
**Category:** General Usage
**Tags:** package
**Created:** [April 30, 2021, 2:51pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321 "2021-04-30T14:51:28Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![maajdl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maajdl/32/22838_2.png) [@maajdl](https://discourse.julialang.org/u/maajdl)
#### Post date: [April 30, 2021, 2:51pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/1 "2021-04-30T14:51:28Z")

</div>

Hello,

I am writing my first small package.  
I found Nemo useful for my purpose and I am using it in my package.  
But it comes with a small trouble:  
`it prints a banner in the Jupyter notebook when it is loaded`.  
Below is the code from Nemo where this happens.  
Would you see how to mute this banner from within my package?  
I could mute it by adding something within the Jupyter notebook:

- either setting ENV[“NEMO\_PRINT\_BANNER”]=…
- or using redirect\_stdout()

But this is almost as annoying as the banner itself !  
Adding these commands within the package doesn’t work!

Any suggestion?

Thanks

Michel

```julia
   if isinteractive() &&
         !any(x -> x.name in ("Hecke", "Oscar", "Singular"), keys(Base.package_locks)) &&
         get(ENV, "NEMO_PRINT_BANNER", "true") != "false"

      println("")
      println("Welcome to Nemo version $(version())")
      println("")
      println("Nemo comes with absolutely no warranty whatsoever")
      println("")
   end

```

---

<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: [April 30, 2021, 2:59pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/2 "2021-04-30T14:59:57Z")

</div>

Related: [Redirecting stdout to avoid banners while `import`ing - #7 by rfourquet](https://discourse.julialang.org/t/redirecting-stdout-to-avoid-banners-while-import-ing/37633/7)

---

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [April 30, 2021, 8:58pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/3 "2021-04-30T20:58:16Z")

</div>

I do things like this in similar cases:

```julia
# Redirecting the output to /dev/null
oldstd = stdout
redirect_stdout(open("nul", "w"))
[...]
redirect_stdout(oldstd) # recover original stdout

```

---

<div class="post-metadata">

### Author: ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)
#### Post date: [April 30, 2021, 9:44pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/4 "2021-04-30T21:44:40Z")

</div>

(deleted)

---

<div class="post-metadata">

### Author: ![maajdl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maajdl/32/22838_2.png) [@maajdl](https://discourse.julialang.org/u/maajdl)
#### Post date: [May 1, 2021, 7:10am UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/5 "2021-05-01T07:10:44Z")

</div>

Thanks sylvaticus!

I can indeed redirect within my Juoyter notebook, this works:

```julia
oldstd = stdout
redirect_stdout(open("nul", "w"))
using myPackage
redirect_stdout(oldstd)

```

Within myPackage I am using the Nemo package which is the banner emitter.  
However, if I move the redirect to within myPackage:

```julia
Module myPackage 
    ....
    oldstd = stdout
    redirect_stdout(open("nul", "w"))
    using Nemo
    redirect_stdout(oldstd)
    ....
end

```

then I get the banner again in my notebook.  
I would like to keep the Jupyter notebook clean and simple.  
Therefore I would prefer just `using myPackage` instead of extra code.  
Looks like this is not possible with redirect?  
Probably for good reasons, like avoiding packages to perturb the caller i/o .

Any further idea?

Thanks

Michel

---

<div class="post-metadata">

### Author: ![abulak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abulak/32/28314_2.png) [@abulak](https://discourse.julialang.org/u/abulak)
#### Post date: [May 1, 2021, 8:23am UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/6 "2021-05-01T08:23:36Z")

</div>

the redirection you made is run once during precompilation, therefore it has no effect on `using myPackage`.  
I suggest you open a issue in Nemo repository.

---

<div class="post-metadata">

### Author: ![maajdl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maajdl/32/22838_2.png) [@maajdl](https://discourse.julialang.org/u/maajdl)
#### Post date: [May 1, 2021, 8:35am UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/7 "2021-05-01T08:35:40Z")

</div>

Yes, I have read that elsewhere.  
However, I did some tests and could not really clarify what it means.  
Besides, other people already opened an issue on Nemo, but it was rejected.  
So, either I have to live with it, or I have to hope for an unexpected solution, or I also could duplicate the Nemo package and suppress the banner. The last solution is a bit heavy!

Another remark: I only need a very small part of Nemo.  
The `integer nullspace` function.  
Who knows, maybe I can find it elsewhere?

Thanks abulak,

Michel

---

<div class="post-metadata">

### Author: ![abulak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abulak/32/28314_2.png) [@abulak](https://discourse.julialang.org/u/abulak)
#### Post date: [May 1, 2021, 9:45pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/8 "2021-05-01T21:45:27Z")

</div>

If you have

```julia
module AAA
x = let
    println("setting x=2")
    2
end
end

```

you should see “setting x=2” during precompilation, but not during `using AAA`. the value of `x` in the module is set once, and doesn’t need to be evaluated/changed at `using`. That is what precompilation is about.

The only way of changing something in a package elsewhere is to ask (e.g. by opening an issue) the developers to change it. If you don’t ask, it won’t be changed ever 😉

`AbstractAlgebra.jl` (by the same developers) also has the the `nullspace` implemented but it comes without banner 😜 It will probably be tad slower.

---

<div class="post-metadata">

### Author: ![maajdl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maajdl/32/22838_2.png) [@maajdl](https://discourse.julialang.org/u/maajdl)
#### Post date: [May 2, 2021, 7:10am UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/9 "2021-05-02T07:10:43Z")

</div>

Thanks abulak

At least I now understand exactly how this works !  
Then it’s easier to live with it !

I will check if AbstractAlgebra.jl does “integer nullspace”.  
Probably yes, I just saw that it is the successot of Nemo.jl !!!  
Thanks a lot!

Michel

---

<div class="post-metadata">

### Author: ![rfourquet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rfourquet/32/3610_2.png) [@rfourquet](https://discourse.julialang.org/u/rfourquet)
#### Post date: [May 2, 2021, 6:18pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/10 "2021-05-02T18:18:14Z")

</div>

> [@maajdl](#):
>
> I just saw that it is the successot of Nemo.jl !!!

Where did you see that? Nemo.jl is still pretty much actual. It depends on AbstractAlgebra.jl, which sets up the interfaces and implements generic algebraic structures and algorithms. And Nemo.jl implement these interfaces on types which are wrapped from Flint, so you can generally expect more efficiency from Nemo.jl.

---

<div class="post-metadata">

### Author: ![maajdl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maajdl/32/22838_2.png) [@maajdl](https://discourse.julialang.org/u/maajdl)
#### Post date: [May 2, 2021, 6:23pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/11 "2021-05-02T18:23:37Z")

</div>

That’s how I understood this:

```julia
AbstractAlgebra.jl grew out of the Nemo project after a number of requests 
from the community for the pure Julia part of Nemo to be split
off into a separate project.

```

found there:

[https://nemocas.github.io/AbstractAlgebra.jl/latest/](https://nemocas.github.io/AbstractAlgebra.jl/latest/)

😃

---

<div class="post-metadata">

### Author: ![rfourquet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rfourquet/32/3610_2.png) [@rfourquet](https://discourse.julialang.org/u/rfourquet)
#### Post date: [May 2, 2021, 7:38pm UTC](https://discourse.julialang.org/t/supressing-banner-from-a-package/60321/12 "2021-05-02T19:38:25Z")

</div>

Ok! Maybe I misinterpreted your “AA is the successor of Nemo”, but in your link we can read “AA grew out of Nemo”, which certainly doesn’t mean Nemo is superseded by AA.
