JuliaPy / PyCall.jl

Package to call Python functions from the Julia language
MIT License
1.47k stars 189 forks source link

Cannot build pycall because it doesn't find ctypes #902

Closed BeastyBlacksmith closed 3 years ago

BeastyBlacksmith commented 3 years ago

When trying to build PyCall I get the following error:

ERROR: Error building `PyCall`: 
Traceback (most recent call last):
  File "/home/schrist/.julia/packages/PyCall/BD546/deps/find_libpython.py", line 33, in <module>
    import ctypes.util
  File "/home/schrist/.asdf/installs/python/3.8.5/lib/python3.8/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
ERROR: LoadError: failed process: Process(setenv(`python3 /home/schrist/.julia/packages/PyCall/BD546/deps/find_libpython.py --list-all`,["PATH=/home/schrist/.local/bin:/home/schrist/.asdf/shims:/home/schrist/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", "QT_ACCESSIBILITY=1", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus", "XDG_SESSION_DESKTOP=ubuntu", "SSH_AGENT_PID=1665", "XDG_SESSION_TYPE=x11", "USER=schrist", "QT_IM_MODULE=ibus", "XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg", "JULIA_EDITOR=code"  …  "VSCODE_GIT_ASKPASS_MAIN=/usr/share/code/resources/app/extensions/git/dist/askpass-main.js", "BREAKPAD_DUMP_LOCATION=/home/schrist/.config/Code/exthost Crash Reports", "OPENBLAS_NUM_THREADS=8", "LANGUAGE=de_DE:", "ORIGINAL_XDG_CURRENT_DESKTOP=ubuntu:GNOME", "JOURNAL_STREAM=8:46303", "JULIA_LOAD_PATH=@:/tmp/jl_ORfEkf", "GIO_LAUNCHED_DESKTOP_FILE_PID=301428", "WINDOWPATH=2", "OPENBLAS_MAIN_FREE=1"]), ProcessExited(1)) [1]

My versioninfo():

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, icelake-client)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 

and the PyCall version is v1.92.3.

I tried installing libffi-dev, since the internet said so, but that didn't help.

BeastyBlacksmith commented 3 years ago

I also had to reinstall python itself