# First time Running old Code on Julia 1.9

**URL:** <https://discourse.julialang.org/t/first-time-running-old-code-on-julia-1-9/99239>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [May 22, 2023, 5:10pm UTC](https://discourse.julialang.org/t/first-time-running-old-code-on-julia-1-9/99239 "2023-05-22T17:10:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![loki](https://avatars.discourse-cdn.com/v4/letter/l/3be4f8/32.png) [@loki](https://discourse.julialang.org/u/loki)\
**Post date:** [May 22, 2023, 5:10pm UTC](https://discourse.julialang.org/t/first-time-running-old-code-on-julia-1-9/99239/1 "2023-05-22T17:10:52Z")

</div>

Hello,

I was hoping to see all of the improvements made to Julia 1.9 coming from 1.6. I ended up booting up some old code that was written in 1.6 but running the following code ended up throwing some new errors.

```julia
cd(@ __DIR__ )
using Pkg
Pkg.activate(".")
Pkg.instantiate()

```

My main question is what’s the best procedure to update older code to work with the new Project.toml updates and is it still best practice to include this tid bit of code at the beginning of a piece of code?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [May 22, 2023, 5:18pm UTC](https://discourse.julialang.org/t/first-time-running-old-code-on-julia-1-9/99239/2 "2023-05-22T17:18:22Z")

</div>

you probably need a `Pkg.resolve` since new Julia versions may require different versions of some packages.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 22, 2023, 5:20pm UTC](https://discourse.julialang.org/t/first-time-running-old-code-on-julia-1-9/99239/3 "2023-05-22T17:20:55Z")

</div>

If `resolve` doesn’t solve your problems, can you describe the errors in more details, along with the status of your environment?

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [May 22, 2023, 5:28pm UTC](https://discourse.julialang.org/t/first-time-running-old-code-on-julia-1-9/99239/4 "2023-05-22T17:28:29Z")

</div>

I know that (because of unstable/ ~~undocumented~~ API use), and it seems often needed with Julia (because of a handful of packages (indirectly ) used, but I’m curious do people know or think same principle applies in Python? Python is regularly updated (and old versions maintained for some reason, out of need?), but e.g. distros upgrade, and it seems very bad if scripts wouldn’t just run out of the box. I think most do only rely on `python3` [package] (in Ubuntu, already installed), by now, not some more specific version.

I understand for Python packages/extensions (for C API reasons) need to be compiled for each new version, but I’m not asking for that, that seems shielded from end-users.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [May 22, 2023, 6:25pm UTC](https://discourse.julialang.org/t/first-time-running-old-code-on-julia-1-9/99239/5 "2023-05-22T18:25:42Z")

</div>

If you don’t use any packages and undocumented internals, your code will (most likely) continue working across all 1.x Julia versions.  
But packages are a different story. Almost any (I guess) non-trivial Julia environment from 1.6 times won’t work on 1.9 without updating at least some packages. I only learned that recently, was surprised at first.

---

<div class="post-metadata">

**Author:** ![loki](https://avatars.discourse-cdn.com/v4/letter/l/3be4f8/32.png) [@loki](https://discourse.julialang.org/u/loki)\
**Post date:** [May 23, 2023, 3:41pm UTC](https://discourse.julialang.org/t/first-time-running-old-code-on-julia-1-9/99239/6 "2023-05-23T15:41:09Z")

</div>

Thank you everyone for the suggestions! I suspect I am running into issues with out dated packages as I was trying to avoid having to update anything. Unfortunately I think I’ll need to go through and try to update all of the necessary packages.
