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

Incompatible with PythonCall.jl #1056

Closed
LilithHafner opened this issue Oct 6, 2023 · 5 comments
Closed

Incompatible with PythonCall.jl #1056

LilithHafner opened this issue Oct 6, 2023 · 5 comments

Comments

@LilithHafner
Copy link

I can't load this package and PythonCall.jl in the same Julia session without error

x@x dev % julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _' |  |
  | | |_| | | | (_| |  |  Version 1.9.3 (2023-08-24)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using PyCall, PythonCall
    CondaPkg Found dependencies: /Users/x/.julia/packages/PythonCall/qTEA1/CondaPkg.toml
    CondaPkg Dependencies already up to date
ERROR: InitError: Python: SystemError: initialization of _datetime did not return an extension module
Python stacktrace:
 [1] <module>
   @ 
SYSTEM (REPL): showing an error caused an error
ERROR: Python: 
SYSTEM (REPL): caught exception of type PyException while trying to handle a nested exception; giving up

julia> 
x@x dev % julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _' |  |
  | | |_| | | | (_| |  |  Version 1.9.3 (2023-08-24)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using PythonCall, PyCall
    CondaPkg Found dependencies: /Users/x/.julia/packages/PythonCall/qTEA1/CondaPkg.toml
    CondaPkg Dependencies already up to date
julia(25115,0x206e11b40) malloc: *** error for object 0x137f60050: pointer being freed was not allocated
julia(25115,0x206e11b40) malloc: *** set a breakpoint in malloc_error_break to debug

[25115] signal (6): Abort trap: 6
in expression starting at REPL[1]:1
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 8260202 (Pool: 8255891; Big: 4311); GC: 12
zsh: abort      julia
x@x dev % julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.3 (2023-08-24)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores
Environment:
  JULIA_EDITOR = code
@LilithHafner
Copy link
Author

Adding documentation pointing to https://juliapy.github.io/PythonCall.jl/stable/pycall/#Tips would help, making the error give that hint would be even better.

@PallHaraldsson
Copy link
Contributor

Is this still relevant, or was it actually?

I mean the link no longer works, should point to current docs on using together, which claim possible. I do not want to claim possible to use together, if actually not possible in some edge cases, but I think it might not be impossible if done correctly (maybe only on 1.10.5?).

Should PyCall be deprecated? And/or at the README least point PythonCall.jl, as an alternative? I meant to open an issue/PR, to that effect, but hesitate because of this open one...

@stevengj
Copy link
Member

stevengj commented Sep 2, 2024

In principle, it should be possible to use both PyCall and PythonCall simultaneously, if you configure them to use the same Python installation?

@stevengj
Copy link
Member

stevengj commented Sep 2, 2024

Alternatively, since PythonCall can use any Python determined at runtime, possibly you can tell it to use PyCall's python at runtime if you load the latter first.

@stevengj
Copy link
Member

stevengj commented Sep 2, 2024

This is documented here: https://juliapy.github.io/PythonCall.jl/stable/faq/#Can-I-use-PythonCall-and-PyCall-together?

So I think this issue can be closed?

@stevengj stevengj closed this as completed Sep 2, 2024
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