# Using TensorCast with JuliaPy

**URL:** https://discourse.julialang.org/t/using-tensorcast-with-juliapy/85588
**Category:** General Usage
**Tags:** broadcast, python, arrays, tensors
**Created:** [August 10, 2022, 2:33pm UTC](https://discourse.julialang.org/t/using-tensorcast-with-juliapy/85588 "2022-08-10T14:33:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![andrewkhardy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrewkhardy/32/27311_2.png) [@andrewkhardy](https://discourse.julialang.org/u/andrewkhardy)
#### Post date: [August 10, 2022, 2:33pm UTC](https://discourse.julialang.org/t/using-tensorcast-with-juliapy/85588/1 "2022-08-10T14:33:16Z")

</div>

I am getting a world age bug when running TensorCast in [JuliaPy](https://github.com/JuliaPy/pyjulia), but not when using it normally.

If I run an example function such as

```julia
function testfunc()
    V = [10,20,30]
    M = collect(reshape(1:12, 3,4))
    @cast A[j,i] := M[i,j] + 10 * V[i]
    return A
end

```

it works when I call it in Julia via

```julia
A = testfunc()

```

However, when I run the Python script

```julia
from julia.api import Julia
jl = Julia(compiled_modules=False)
from julia import Main
Main.include("testfunction.jl")
from julia.Main import testfunc

A = testfunc()

```

I get the error

```julia
<PyCall.jlwrap (in a Julia function called from Python)
JULIA: MethodError: no method matching _trex(::Symbol, ::Type{Matrix{Int64}}, ::Tuple{Int64, Int64})
The applicable method may be too new: running in world age 32486, while current world is 38140.
Closest candidates are:
  _trex(::Any, ::Any, ::Any) at /home/andrewhardy/.julia/packages/TransmuteDims/mGkQB/src/TransmuteDims.jl:372 (method too new to be called from this world context.)

```

which only occurs for the `@cast` call. What can I do?
