Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyCall build errors on Ubuntu 18.04 #708

Closed
macd opened this issue Aug 17, 2019 · 3 comments
Closed

PyCall build errors on Ubuntu 18.04 #708

macd opened this issue Aug 17, 2019 · 3 comments

Comments

@macd
Copy link

macd commented Aug 17, 2019

I don't think this is related to #704, but I cannot build PyCall
on Ubuntu 18.04 with master julia and master PyCall, but there does exist a hack to fix.
Also, I am using Conda.jl with CONDA_JL_HOME=/home/macd/anaconda3/envs/conda_jl,
which does successfully build.

First the error:

(v1.4) pkg> build PyCall
  Building Conda ─→ `~/julia-versions/dot_julia-1.4/packages/Conda/kLXeC/deps/build.log`
  Building PyCall → `~/jlang/dev/PyCall.jl/deps/build.log`
 Resolving package versions...
┌ Error: Error building `PyCall`: 
│ Collecting package metadata (current_repodata.json): ...working... done
│ Solving environment: ...working... done
│ 
│ # All requested packages already installed.
│ 
│   File "<string>", line 1
│     import sys; print(sys.executable
│                                    ^
│ SyntaxError: unexpected EOF while parsing
│ ┌ Info: No system-wide Python was found; got the following error:
│ │ MethodError(adjoint, ("get_config_var('VERSION)",), 0x0000000000006892)
│ └ using the Python distribution in the Conda package
│ [ Info: Running `conda install -y numpy` in root environment
...

The 'fix' is to escape a right parens, ie the following line in buildutils.jl

pyvar(python::AbstractString, mod::AbstractString, var::AbstractString) = chomp(read(pythonenv(`$python -c "import $mod; print($mod.$var)"`), String))

must be changed to

pyvar(python::AbstractString, mod::AbstractString, var::AbstractString) = chomp(read(pythonenv(`$python -c "import $mod; print($mod.$var\)"`), String))

Notice the escape on the right parens on print($mod.$var\)

Did not do a PR, since this is obviously not the correct fix, but
a hack to work around an interpolation problem somewhere else.

@chriselrod
Copy link

I have the same problem on Clear Linux.

@tkf
Copy link
Member

tkf commented Aug 18, 2019

See JuliaLang/julia#32948 and JuliaLang/julia#32408 (comment)

@stevengj
Copy link
Member

As I understand it, the bug is worked around by parenthesizing $(var) during interpolation, which we might as well do for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants