# Use of packages

**URL:** <https://discourse.julialang.org/t/use-of-packages/14140>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [August 27, 2018, 3:11pm UTC](https://discourse.julialang.org/t/use-of-packages/14140 "2018-08-27T15:11:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen\_Mebis](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@Jeroen\_Mebis](https://discourse.julialang.org/u/Jeroen_Mebis)\
**Post date:** [August 27, 2018, 3:11pm UTC](https://discourse.julialang.org/t/use-of-packages/14140/1 "2018-08-27T15:11:02Z")

</div>

I was trying to use the Base64EncodePipe() function but it didn’t work.  
I figured out that I need the type ‘using Base64’ first. This function is from the Standard Library so why is this needed?

And where can I find more information concerning packages and how to use them?

Thanks!

```julia

```

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [August 29, 2018, 9:46pm UTC](https://discourse.julialang.org/t/use-of-packages/14140/2 "2018-08-29T21:46:04Z")

</div>

I think this is how Julia works, go to any stdlib, [https://docs.julialang.org/en/latest/stdlib/Base64/](https://docs.julialang.org/en/latest/stdlib/Base64/)  
or  
[https://docs.julialang.org/en/latest/stdlib/Dates/](https://docs.julialang.org/en/latest/stdlib/Dates/)  
You will have to `import` or `using` them first.

---

<div class="post-metadata">

**Author:** ![Jeroen\_Mebis](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@Jeroen\_Mebis](https://discourse.julialang.org/u/Jeroen_Mebis)\
**Post date:** [August 30, 2018, 4:28pm UTC](https://discourse.julialang.org/t/use-of-packages/14140/3 "2018-08-30T16:28:19Z")

</div>

Hi Jerrryling315

Thank you for your answer.

I’ve downgraded my Julia version to 0.7. This is the same version my colleague is using and the necessary packages are installed automatically.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [August 31, 2018, 5:06am UTC](https://discourse.julialang.org/t/use-of-packages/14140/4 "2018-08-31T05:06:04Z")

</div>

Julia 0.7 differs from 1.0 only in that the old bindings work but give you a deprecation warning.

In 0.7/1.0, a lot of packages got moved out of Base and into their own packages in order to make it easier to push bugfixes and the like to them; they are now in a “stdlib” of preinstalled packages, but like any other regular package you still have to clarify their use with `using`. You just don’t have to `add` them first.

---

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [August 31, 2018, 6:46am UTC](https://discourse.julialang.org/t/use-of-packages/14140/5 "2018-08-31T06:46:40Z")

</div>

```julia
               _
   _ _ _(_)_ | A fresh approach to technical computing
  (_) | (_) (_) | Documentation: https://docs.julialang.org
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 0.7.0 (2018-08-08 06:46 UTC)
 _/ |\ __'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-w64-mingw32

julia> Base64EncodePipe()
WARNING: Base.Base64EncodePipe is deprecated: it has been moved to the standard library package `Base64`.
Add `using Base64` to your imports.
 in module Main
ERROR: MethodError: no method matching Base64.Base64EncodePipe()
Closest candidates are:
  Base64.Base64EncodePipe(::IO) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Base64\src\encode.jl:40
Stacktrace:
 [1] top-level scope at none:0

               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.0.0 (2018-08-08)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using Base64

julia> tmp = tempname()
"C:\\Users\\tfr004\\AppData\\Local\\Temp\\jl_C5E8.tmp"

julia> fil = open(tmp,"w")
IOStream(<file C:\Users\tfr004\AppData\Local\Temp\jl_C5E8.tmp>)

julia> Base64EncodePipe(fil)
Base64EncodePipe(IOStream(<file C:\Users\tfr004\AppData\Local\Temp\jl_C5E8.tmp>), Base64.Buffer(UInt8[0x70, 0x0b, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0b … 0x00, 0x00, 0x10, 0x0f, 0x57, 0x05, 0x00, 0x00, 0x00, 0x00], Ptr{UInt8} @0x000000000edecef0, 0))

julia>

```

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [August 31, 2018, 7:26am UTC](https://discourse.julialang.org/t/use-of-packages/14140/6 "2018-08-31T07:26:24Z")

</div>

> [@Jeroen\_Mebis](#):
>
> I figured out that I need the type ‘using Base64’ first. This function is from the Standard Library so why is this needed?

This is how most standard libraries work really.

Consider in C, you would need to `#include <stdio.h>` to have any IO functions, and by default you only have things like `+`

In python without loading any libraries you only have a few functions and datatyles like `dict` but if you do `from collections import *` you also now have `defaultdict`.

Julia by default you have all the things from the `Base` standard library – so `using Base` does nothing.  
But for other standard libraries, like `Base64` or `Test` you need to load them using `using`.

The main thing that makes them standard libraries is that they are distributed with julia.  
In general through they are not much different from external packages.  
This is intentional; basically nothing in the standard libraries (including `Base` (but excluding `Core`)) is in any way privileged over normal user code in another package in capability.

---

<div class="post-metadata">

**Author:** ![Jeroen\_Mebis](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@Jeroen\_Mebis](https://discourse.julialang.org/u/Jeroen_Mebis)\
**Post date:** [September 4, 2018, 7:07am UTC](https://discourse.julialang.org/t/use-of-packages/14140/7 "2018-09-04T07:07:27Z")

</div>

Thank you all for the answers.
