-
Notifications
You must be signed in to change notification settings - Fork 71
Using Python.jl and PyCall.jl together #6
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
Comments
I just changed Python so it works even if libpython was already initialised, e.g. by PyCall. Provided they are using the same libpython I don't see why there should be any problem. I get no segfault (windows, miniconda, Julia 1.5). What's your segfault? |
These options can take a lot of time off startup (from 31 sec for me), but I get same segfault either way:
If I start with PyCall, I get this error for your package:
|
I couldn't reproduce this on MacOS or Windows. Could you update
|
Feel free to just close this as "user error", or to document this and/or make two different Python versions work. At least it's "documented" here, in case people look here. It's valuable to use PyCall.jl and Python.jl together I guess (assuming works, didn't go further than I didn't realize I had 3.6 and 3.8 (python3 for the latter, but pip3 for the former, why I found out...). What fixed this for me:
This was likely never a Linux issue, would have been on all platforms. Before:
|
Good to know it was a version issue, thanks. I have just added a check that Python and PyCall are using the same version, and emit a warning if not. Grateful if you could check you see the warning? |
Yes, if I go back to libpython to being different I do get the warning, but only if I do This is however not really a huge concern for me, as I said, the important thing is that both can work together, as they do in the usual case. Unlike PyCall, I see you have lots of code, which I guess slows down init, to support e.g. Pandas. There are other ways to speed it up besides dropping the code, but should i be optional? In an addon package? and FYI: since I see you added trademark mark, I see at Python.org, that it's the correct one is actually "TM". |
You should get a warning in either order. I use Requires.jl to detect if PyCall.jl was loaded after. The large amount of code mainly comes from the Julia wrapper types and the general conversion system. The "helpers" (such as pandas support) are tiny. The slow init time comes from needing to compile C functions. Python's trademark usage policy says to put "(R)" after the word Python. It's the logo that requires "TM". |
FYI you can now set JULIA_PYTHONCALL_EXE=PYCALL to ensure compatability. |
Uh oh!
There was an error while loading. Please reload this page.
If I do:
the latter segfaults (at least on 1.6-rc1). For the reverse order I do get an error.
I don't personally need both to work, just curious if they could (probably not). That's not really the end-goal, but some packages do have PyCall as a dependency, e.g. PyPlot.jl and Pandas.jl. Is there a good way to support such, as it seems this package has a similar API as PyCall?
The text was updated successfully, but these errors were encountered: