# Install PyCall on travis

**URL:** <https://discourse.julialang.org/t/install-pycall-on-travis/15921>\
**Category:** General Usage\
**Tags:** package\
**Created:** [October 5, 2018, 11:44am UTC](https://discourse.julialang.org/t/install-pycall-on-travis/15921 "2018-10-05T11:44:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fincardona](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@fincardona](https://discourse.julialang.org/u/fincardona)\
**Post date:** [October 5, 2018, 11:44am UTC](https://discourse.julialang.org/t/install-pycall-on-travis/15921/1 "2018-10-05T11:44:21Z")

</div>

Hello!

I’m trying to develop a package for Julia which calls Astropy through PyCall. How can I install PyCall on travis?

thanks a lot

---

<div class="post-metadata">

**Author:** ![Balinus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/balinus/32/243_2.png) [@Balinus](https://discourse.julialang.org/u/Balinus)\
**Post date:** [October 5, 2018, 1:13pm UTC](https://discourse.julialang.org/t/install-pycall-on-travis/15921/2 "2018-10-05T13:13:13Z")

</div>

See here for an example. There’s a `before_install` section that covers installing some package before the testing phase.

[https://github.com/Balinus/ClimateTools.jl/blob/master/.travis.yml](https://github.com/Balinus/ClimateTools.jl/blob/master/.travis.yml)

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [October 5, 2018, 1:26pm UTC](https://discourse.julialang.org/t/install-pycall-on-travis/15921/3 "2018-10-05T13:26:20Z")

</div>

Actually, PyCall should work just like any other Julia package. You simply need to make sure PyCall is in your Project.toml (see also [here](https://docs.julialang.org/en/v1/stdlib/Pkg/)). I do not think you need to modify .travis.yml.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 5, 2018, 2:54pm UTC](https://discourse.julialang.org/t/install-pycall-on-travis/15921/4 "2018-10-05T14:54:18Z")

</div>

> [@bernhard](#):
>
> Actually, PyCall should work just like any other Julia package. You simply need to make sure PyCall is in your Project.toml

Yes, with the caveat it will default to using `python3` and you need to make sure that any Python packages you want to use (e.g. numpy) are installed for the Python version you are using.

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [October 5, 2018, 3:18pm UTC](https://discourse.julialang.org/t/install-pycall-on-travis/15921/5 "2018-10-05T15:18:25Z")

</div>

Although one can install packages in the julia module by using and init function.  
Something like this might work, if am not mistaken.

```julia
global const pyModPandas = PyCall.PyNULL()

function __init__ ()
        copy!(pyModPandas, PyCall.pyimport_conda("pandas","pandas"))        
end

```

---

<div class="post-metadata">

**Author:** ![fincardona](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@fincardona](https://discourse.julialang.org/u/fincardona)\
**Post date:** [October 8, 2018, 11:26am UTC](https://discourse.julialang.org/t/install-pycall-on-travis/15921/6 "2018-10-08T11:26:51Z")

</div>

Thanks a lot Balinus, now it works properly
