# ERROR using JumpProcesses and Catalyst

**URL:** <https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753>\
**Category:** General Usage\
**Created:** [February 5, 2024, 4:29pm UTC](https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753 "2024-02-05T16:29:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![martacunial](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martacunial/32/206791_2.png) [@martacunial](https://discourse.julialang.org/u/martacunial)\
**Post date:** [February 5, 2024, 4:29pm UTC](https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753/1 "2024-02-05T16:29:53Z")

</div>

I’m trying to run this code (julia version 1.9.2) found on [Continuous-Time Jump Processes and Gillespie Methods · JumpProcesses.jl](https://docs.sciml.ai/JumpProcesses/stable/tutorials/discrete_stochastic_example/#ssa_tutorial) and I get the error "JumpSystem equations must contain MassActionJumps, ConstantRateJumps, or VariableRateJumps.  
"  
using Catalyst,JumpProcesses  
sir\_model = @reaction\_network begin  
β, S + I → 2I  
ν, I → R  
end  
p = (:β =\> 0.1 / 1000, :ν =\> 0.01)  
u₀ = [:S =\> 990, :I =\> 10, :R =\> 0]  
tspan = (0.0, 250.0)  
prob = DiscreteProblem(sir\_model, u₀, tspan, p)

Can someone help me? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 6, 2024, 12:57am UTC](https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753/2 "2024-02-06T00:57:14Z")

</div>

What package versions?

---

<div class="post-metadata">

**Author:** ![martacunial](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martacunial/32/206791_2.png) [@martacunial](https://discourse.julialang.org/u/martacunial)\
**Post date:** [February 6, 2024, 9:06am UTC](https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753/3 "2024-02-06T09:06:01Z")

</div>

I’m using JumpProcesses v9.3.2 and Catalyst v12.1.1. I’ve just run Pkg.update() and these are the installed versions I have.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 6, 2024, 9:25am UTC](https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753/4 "2024-02-06T09:25:20Z")

</div>

It’s always useful to run the versions for which you are reading the docs; clicking on your link you’ll see in the bottom left corner:

![image](https://global.discourse-cdn.com/julialang/original/3X/7/c/7cb7e689c838049138e7ab0ee773f964c9e8ebe1.png)

Likewise, the current Catalyst release seems to be 13.5.1 so your version is quite outdated.

Make sure you are working in a project-specific environment which only includes the packages you need for your analysis, see:

[https://pkgdocs.julialang.org/v1/environments/](https://pkgdocs.julialang.org/v1/environments/)

If for some reason you can’t use the latest versions of the packages you need, make sure to read the documentation for the versions you are using (as you see in the screenshot above you can select an older version of the docs from the dropdown menu).

---

<div class="post-metadata">

**Author:** ![martacunial](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martacunial/32/206791_2.png) [@martacunial](https://discourse.julialang.org/u/martacunial)\
**Post date:** [February 6, 2024, 11:01am UTC](https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753/5 "2024-02-06T11:01:47Z")

</div>

Thank you for your answer, is there a reason for which the packages Catalyst and JumpProcesses were not installed in their latest version when I run "Pkg.add(“Catalyst”)?

---

<div class="post-metadata">

**Author:** ![isaacsas](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@isaacsas](https://discourse.julialang.org/u/isaacsas)\
**Post date:** [February 6, 2024, 1:05pm UTC](https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753/6 "2024-02-06T13:05:29Z")

</div>

The most common reason for getting older package versions is that you are installing these packages into your global environment in which you have another package installed that is incompatible with their most recent versions. That other package then prevents the latest version of them being installed. The easiest thing to do is create a new, empty environment for each project you are working on and just install the exact packages you need into it. That usually allows you to get the latest versions. A benefit of this approach is you can share the environment Project.toml and Manifest.toml with others to have a reproducible project.

For example, you could do

```julia
using Package

# creates a new environment in the current folder named catalyst_project
Pkg.activate("catalyst_project") 
Pkg.add("Catalyst")
Pkg.add("JumpProcesses")

```

This should result in you having the latest versions of these packages and your code working.

---

<div class="post-metadata">

**Author:** ![martacunial](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martacunial/32/206791_2.png) [@martacunial](https://discourse.julialang.org/u/martacunial)\
**Post date:** [February 7, 2024, 7:43am UTC](https://discourse.julialang.org/t/error-using-jumpprocesses-and-catalyst/109753/7 "2024-02-07T07:43:38Z")

</div>

Thank you ! Creating a new environment worked well for me and I managed to install the latest versions of the packages.
