# Error building PyCall in v0.7 / Conda.jl did not install Python?

**URL:** <https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104>\
**Category:** General Usage\
**Created:** [September 18, 2018, 2:27am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104 "2018-09-18T02:27:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [September 18, 2018, 2:27am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/1 "2018-09-18T02:27:13Z")

</div>

Hello,

I’m trying to move to Julia 0.7 on Ubuntu. I installed Conda.jl without errors but I’m having trouble with PyCall:

```julia
julia> Pkg.build("PyCall")
  Building Conda ─→ `~/.julia/packages/Conda/m7vem/deps/build.log`
  Building PyCall → `~/.julia/packages/PyCall/rUul9/deps/build.log`
┌ Error: Error building `PyCall`: 
│ Traceback (most recent call last):
│ File "<string>", line 1, in <module>
│ ModuleNotFoundError: No module named 'distutils.sysconfig'
│ ┌ Info: No system-wide Python was found; got the following error:
│ │ ErrorException("failed process: Process(setenv(`python3 -c \"import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'))\"`
...

```

That Python command indeed fails on Ubuntu. Apparently the reason is that Debian has broken distutils.sysconfig:

> <https://stackoverflow.com/questions/28011865/why-cant-my-virtualenv-find-distutils-sysconfig>

But this should all be resolved if I just switch to a Python distribution that did not come from Debian. I thought that that was exactly what Conda.jl was supposed to do. In my Julia v0.6 install I see that Conda has a copy of Python in

`~/.julia/v0.6/Conda/deps/usr/bin/python`

But I cannot find a similar Python install now in v0.7/Conda. In fact, Conda doesn’t seem to have installed almost anything at all.

```julia
~ % cd ~/.julia/packages/Conda 
~/.julia/packages/Conda % find . -name python
~/.julia/packages/Conda % ls
m7vem/
~/.julia/packages/Conda %
~/.julia/packages/Conda % ls m7vem/deps/usr
~/.julia/packages/Conda %

```

So I’m not really sure where to go from here. I think that the solution to my problem with PyCall is to use Conda to install a separate copy of Python, but I can’t figure out why that didn’t happen the moment I installed Conda.

Any help would be greatly appreciated.

---

<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:** [September 18, 2018, 2:39am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/2 "2018-09-18T02:39:39Z")

</div>

It probably would be fixed by [https://github.com/JuliaPy/PyCall.jl/pull/556](https://github.com/JuliaPy/PyCall.jl/pull/556) (See also [https://github.com/JuliaPy/PyCall.jl/issues/565](https://github.com/JuliaPy/PyCall.jl/issues/565))

BTW, you can find the location of Conda.jl by `using Conda; pathof(Conda)` in Julia \>= 0.7.

---

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [September 18, 2018, 3:03am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/3 "2018-09-18T03:03:50Z")

</div>

Thanks. I can’t figure out how to bring those changes into my local copy of PyCall. I don’t use git a lot; I’m not sure how to handle PRs.

---

<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:** [September 18, 2018, 3:25am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/4 "2018-09-18T03:25:23Z")

</div>

Does executing `] add PyCall#remotes/cache/pull/556/head` in Julia REPL work?

---

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [September 18, 2018, 3:55am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/5 "2018-09-18T03:55:55Z")

</div>

That seems to indeed pull the PR. When I tried that I got the errors again, but then I noticed that it was also complaining about curl. Then I figured that this computer doesn’t have curl installed and for some reason I never noticed. I installed curl and rebuilt Conda, PyCall, and PyPlot and all of that seems to have worked. I even have a Python distribution inside Conda now.

I’ve now verified that PyPlot works. So in the end it seems that the problem was a missing curl.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [September 18, 2018, 3:57am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/6 "2018-09-18T03:57:02Z")

</div>

Oh, one follow-up question: I see that `]` creates some kind of “pkg” shell. That’s great. Now how do I get out to go back to the regular julia REPL?

---

<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:** [September 18, 2018, 3:57am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/7 "2018-09-18T03:57:53Z")

</div>

backspace (ctrl-h) should do it

---

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [September 18, 2018, 3:58am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/8 "2018-09-18T03:58:32Z")

</div>

Thanks!

---

<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:** [September 18, 2018, 4:04am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/9 "2018-09-18T04:04:00Z")

</div>

PR 556 is supposed to work even without Conda.jl (though using Conda is OK as well). In case you want to switch Python distribution/environment, checkout [GitHub - JuliaPy/PyCall.jl: Package to call Python functions from the Julia language](https://github.com/JuliaPy/PyCall.jl#specifying-the-python-version)

Oh, and don’t forget to do `] free PyCall` once the new version of PyCall is released.

---

<div class="post-metadata">

**Author:** ![danielc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielc/32/220_2.png) [@danielc](https://discourse.julialang.org/u/danielc)\
**Post date:** [September 18, 2018, 5:18am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/10 "2018-09-18T05:18:59Z")

</div>

Thanks. What does `] free PyCall` do?

---

<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:** [September 18, 2018, 5:40am UTC](https://discourse.julialang.org/t/error-building-pycall-in-v0-7-conda-jl-did-not-install-python/15104/11 "2018-09-18T05:40:24Z")

</div>

See `]?free` (and also `]?add`):

```julia
(v1.0) pkg> ?free
  free pkg[=uuid] ...

  Free a pinned package pkg, which allows it to be upgraded or downgraded again. If the package is checked out
  (see help develop) then this command makes the package no longer being checked out.

```
