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

Building pyCalll fails after update from 1.18.4 to 1.18.5 on Julia 1.0.1 #592

Closed
kurbkid opened this issue Oct 16, 2018 · 8 comments
Closed

Comments

@kurbkid
Copy link

kurbkid commented Oct 16, 2018

output of package update:

(v1.0) pkg> update
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed Compat ───────── v1.3.0
 Installed BinaryProvider ─ v0.5.2
 Installed PyCall ───────── v1.18.5
 Installed Conda ────────── v1.1.1
 Installed CMake ────────── v1.1.0
  Updating `~/.julia/environments/v1.0/Project.toml`
  [8f4d0f93] ↑ Conda v1.0.2 ⇒ v1.1.1
  [438e738f] ↑ PyCall v1.18.4 ⇒ v1.18.5
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [b99e7846] ↑ BinaryProvider v0.5.1 ⇒ v0.5.2
  [631607c0] ↑ CMake v1.0.2 ⇒ v1.1.0
  [34da2185] ↑ Compat v1.2.0 ⇒ v1.3.0
  [8f4d0f93] ↑ Conda v1.0.2 ⇒ v1.1.1
  [438e738f] ↑ PyCall v1.18.4 ⇒ v1.18.5
  Building Conda ─→ `~/.julia/packages/Conda/uQitS/deps/build.log`
  Building PyCall → `~/.julia/packages/PyCall/0jMpb/deps/build.log`
┌ Error: Error building `PyCall`:
│ ERROR: LoadError: UndefVarError: v not defined
│ Stacktrace:
│  [1] find_libpython(::String) at /home/dicbro/.julia/packages/PyCall/0jMpb/deps/build.jl:101
│  [2] top-level scope at logging.jl:313
│  [3] top-level scope at /home/dicbro/.julia/packages/PyCall/0jMpb/deps/build.jl:170
│  [4] include at ./boot.jl:317 [inlined]
│  [5] include_relative(::Module, ::String) at ./loading.jl:1041
│  [6] include(::Module, ::String) at ./sysimg.jl:29
│  [7] include(::String) at ./client.jl:388
│  [8] top-level scope at none:0
│ in expression starting at /home/dicbro/.julia/packages/PyCall/0jMpb/deps/build.jl:144
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1069

help

@tkf
Copy link
Member

tkf commented Oct 16, 2018

There is a bug I introduced in error handling (already fixed in master). But this still indicates that Python configuration failed. See alo: https://discourse.julialang.org/t/error-building-pycall/16270/4

To get more information, you can run:

ENV["PYCALL_DEBUG_BUILD"] = "yes"
using Pkg
Pkg.build("PyCall")
print(read(joinpath(dirname(dirname(Base.find_package("PyCall"))), "deps", "build.log"), String))

@kurbkid
Copy link
Author

kurbkid commented Oct 17, 2018

It was not finding the custom pythonpath that the Conda package had installed. After reading README.md (which i should have done immediately) I found I should have set ENV["PYTHON"]="" to do this. It works now. Thanks for your reply.

For others who might stumble across this. For a pythonpath just for Julia when building Conda you need ENV["PYTHONPATH"]="" and then for using this path when building PyCall, you need ENV["PYTHON"]="".

@tkf
Copy link
Member

tkf commented Oct 17, 2018

Interesting... What is the OS your using? How do you install Python? Also, what is the output of the following?

versioninfo(verbose=true)
run(`which python`)

built Conda with ENV["PYTHONPATH"]=""

I think what you meant to run was ENV["PYTHON"]=""

@kurbkid
Copy link
Author

kurbkid commented Oct 17, 2018

Thanks. Just figured that out and edited my last comment. Indeed confused about PYTHONPATH and PYTHON.

@tkf tkf mentioned this issue Oct 17, 2018
1 task
tkf added a commit to tkf/PyCall.jl that referenced this issue Oct 17, 2018
See the first version of the comment
JuliaPy#592 (comment)
@tkf
Copy link
Member

tkf commented Oct 17, 2018

Your previous comment #592 (comment) helped me find yet another bug (fixed in #595). Thanks!

Do you mind let us know the OS you are using and the output of the above command I mentioned #592 (comment)?

@kurbkid
Copy link
Author

kurbkid commented Oct 17, 2018

Stuff is working now. So idk if this is still helpful. But here you go:

julia> run(`which python`)
/home/dicbro/.conda/envs/anaconda2/bin/python
Process(`which python`, ProcessExited(0))
julia> versioninfo(verbose=true)
Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
      "openSUSE 13.2 (Harlequin) (x86_64)"
  uname: Linux 4.5.0-4.gece3ff2-default #1 SMP PREEMPT Thu Mar 24 12:22:16 UTC 2016 (ece3ff2) x86_64 x86_64
  CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz: 
              speed         user         nice          sys         idle          irq
       #1  3798 MHz   11348334 s     163968 s    3488388 s  294146342 s          0 s
       #2  3791 MHz   11881077 s     157164 s    3529210 s  294401142 s          0 s
       #3  3800 MHz   13058425 s     157919 s    3323961 s  293520567 s          0 s
       #4  3800 MHz   13564006 s     158556 s    3250904 s  293225968 s          0 s
       #5  3800 MHz    8824203 s      69160 s    1603988 s  300578707 s          0 s
       #6  3800 MHz    8188936 s      65328 s    1600962 s  301231022 s          0 s
       #7  3785 MHz    7941367 s      67409 s    1445240 s  301616918 s          0 s
       #8  3800 MHz   11334638 s      78944 s    1475133 s  297719140 s          0 s
       
  Memory: 31.343273162841797 GB (14191.5859375 MB free)
  Uptime: 3.119183e6 sec
  Load Avg:  0.97265625  0.9521484375  0.92138671875
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Environment:
  MANPATH = /usr/local/texlive/2012/texmf/doc/man:/usr/local/texlive/2012/texmf/doc/man:/usr/local/share/man:/usr/share/man
  TERM = xterm
  JRE_HOME = /usr/lib64/jvm/jre
  XNLSPATH = /usr/share/X11/nls
  PATH = /home/dicbro/.conda/envs/anaconda2/bin:/home/dicbro/bin:/home/dicbro/juno/julia/bin:/usr/local/texlive/2012/bin/x86_64-linux:/usr/local/apps/java/bin:/home/dicbro/.conda/envs/anaconda2/bin:/home/dicbro/bin:/home/dicbro/juno/julia/bin:/usr/local/texlive/2012/bin/x86_64-linux:/usr/local/apps/java/bin:/home/dicbro/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
  JAVA_HOME = /usr/local/apps/java
  HOME = /home/dicbro
  ALSA_CONFIG_PATH = /etc/alsa-pulse.conf
  WINDOWPATH = 7
  PROFILEHOME = 
  QT_PLUGIN_PATH = /home/dicbro/.kde4/lib64/kde4/plugins/:/usr/lib64/kde4/plugins/

@tkf
Copy link
Member

tkf commented Oct 17, 2018

Ah yes, it would be more informative if it's done before you re-build PyCall. But thanks anyway. I'm closing the issue since it's fixed in your setup.

(So it looks like in openSUSE libpython may not be installed by default? Maybe it's similar to Debian family...)

@tkf tkf closed this as completed Oct 17, 2018
stevengj pushed a commit that referenced this issue Oct 17, 2018
* Fix show_dlopen_error

See the first version of the comment
#592 (comment)

* Fix a possible bug in exec_find_libpython

The previous code accidentally worked presumably because $PWD was set
do deps when running deps/build.jl.  Cherry-picked from #595.
@keithreid-sfw
Copy link

Also watch out for 32 bit Julia trying to PyCall from a 64 bit Jupyter Notebook

This happened to me because I did 'sudo snap install julia' from ubuntu terminal and it found a 32 bit version and I didn't realise for an hour or so.

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

3 participants