# Julia / Python 2 / Python 3 interoperability

**URL:** <https://discourse.julialang.org/t/julia-python-2-python-3-interoperability/27541>\
**Category:** General Usage\
**Created:** [August 14, 2019, 3:25pm UTC](https://discourse.julialang.org/t/julia-python-2-python-3-interoperability/27541 "2019-08-14T15:25:27Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [August 14, 2019, 11:31pm UTC](https://discourse.julialang.org/t/julia-python-2-python-3-interoperability/27541/9 "2019-08-14T23:31:02Z")

</div>

See [https://github.com/JuliaPy/PyCall.jl/tree/master/aot](https://github.com/JuliaPy/PyCall.jl/tree/master/aot)

I guess it would be something like

```julia
PYTHON=python2 aot/compile.jl --color=yes
cp aot/sys.so sys-python2.so # copy it to somewhere
julia -J sys-python2.so

```

You might also want to add

```julia
Base.eval(Base, quote
    function package_slug(uuid::UUID, p::Int=5)
        crc = _crc32c(uuid)
        crc = _crc32c(unsafe_string(JLOptions().image_file), crc)
        return slug(crc, p)
    end
end)

```

in `aot/precompile.jl` so that precompilation cache for `sys-python2.so` is isolated from your normal precompilation cache. (I’ve been using this trick in jlm and PyJulia; ref [ANN: a solution to the precompilation problem: JuliaManager.jl / jlm CLI, a system image manger for Julia](https://discourse.julialang.org/t/ann-a-solution-to-the-precompilation-problem-juliamanager-jl-jlm-cli-a-system-image-manger-for-julia/22849))

---

_[View the full topic](https://discourse.julialang.org/t/julia-python-2-python-3-interoperability/27541)._
