Questions tagged [pycall]
54 questions
36
votes
2 answers
I have a high-performant function written in Julia, how can I use it from Python?
I have a found a Julia function that nicely does the job I need.
How can I quickly integrate it to be able to call it from Python?
Suppose the function is
f(x,y) = 2x.+y
What is the best and most elegent way to use it from Python?

Przemyslaw Szufel
- 40,002
- 3
- 32
- 62
6
votes
2 answers
How to convert Pandas DataFrame to Julia DataFrame.jl
I have not been able to find a way to convert my 30,000 x 1,000 Pandas.jl String DataFrame into a DataFrames.jl DataFrame. I have attempted previous stackoverflow solutions but they have not worked. I would like to know what the best way is to…

Jack N
- 324
- 2
- 14
6
votes
2 answers
PyCall can't find scipy in Julia
I'm currently rewriting a bunch of matlab code into julia. These codes envolves a lot of math and, particularly, interpolation functions for a 3D mesh. It is easy to deal with this in matlab: all I need to do is to use interp3 function. Once I…

Gabriel Neves
- 151
- 6
6
votes
1 answer
PyCall unable to use pipenv version of python InitError:Incompatible `libpython` detected
Following the instructions on the PyCall.jl readme, I am tying to use a pipenv python when using PyCall for my julia project (in it's own environment).
In a terminal, I have activated the python environment using pipenv shell, and then located the…

PeptideWitch
- 2,239
- 14
- 30
5
votes
1 answer
Error while targeting a Julia function into multiprocessing.Process of Python
I am trying to parallelize a code in python by using multiprocessing.Process which targets a Julia function.
The function works fine when I call it directly, i.e. when I execute:
if __name__ == "__main__":
import julia
…
5
votes
2 answers
How to use in Julia a Python package that is not available in Anaconda and needs to be installed via pip
I use Julia 1.6.0 (beta as of today) and would like to use a Python package plfit via PyCall.
Unfortunately, plfit is not available in Anaconda and hence I cannot install it using Conda module:
julia> using Conda
julia> Conda.add("plfit")
[ Info:…

Przemyslaw Szufel
- 40,002
- 3
- 32
- 62
4
votes
1 answer
can't call julia code from Python with PyCall, whose code calls python back with Pycall
I have a backend algorithm which makes julia calls, I do this via the PyCall package.
however, one of the packages in julia recently updated, and it itself makes use of PyCall.
no mater what I try to do, I always get an error.
If i set pycall in…

Flying Turtle
- 366
- 7
- 20
4
votes
1 answer
Julia: Failure to Configure PyCall to use a Different Version
I'm wanting to use a range of Python libraries in my Julia code. I've been trying to use PyCall to access the Python libraries I have installed on my (windows) PC already; however, I have been unable to reconfigure PyCall away from its default…

Caleb
- 65
- 5
3
votes
0 answers
Julia's PyCall package generates Segmentation fault
I'm currently using PyCall to load a Python library for data compression based on LZ-77 into Julia. The python library is sweetsourcod and I have it installed in my home directory. Within that library, I am using the module lempel_ziv for some…

Computer_Chemist_01
- 181
- 1
- 2
- 9
3
votes
1 answer
Julia function to run julia method in python class
I'm learning julia (v1.6) and I'm trying to create a julia function to run a julia method from a python class (pycall equivalent) where the method is a print.
I've tried different things and I get different errors either creating the class or…

jfcabreras
- 141
- 1
- 1
- 9
3
votes
2 answers
Github Actions CI: making PyCall aware of Julia ENV variables
I want to setup a Github action ci.yml file that installs Python and Julia and then builds and tests a package using PyCall. PyCall in this case should make use of the previously installed Python version and not it's default julia-specific Python…

mks
- 422
- 5
- 15
3
votes
2 answers
I want to use OpenCV on Julia via PyCall
I want to use OpenCV on Julia, then I tried to use PyCall.
I made my Python environment by pyenv, therefore, I tried below commands;
julia> ENV["PYTHON"] = "/Users/MYNAME/.pyenv/shims/python"
julia> using Pkg
julia> Pkg.add("PyCall")
Then, I tried…

Kotaro Nomura
- 131
- 5
3
votes
1 answer
PyCall receving Numpy and convert to native types element
I'm having some difficulty to convert a numpy matrix to Julia array with native types.
So here is my problem: I have a code that returns a numpy matrix with the firsts 73 columns are bool that represents a feature array and the last column the…

Raul Britto
- 47
- 1
- 5
3
votes
1 answer
Parameter of Python function call is reserved word in Julia
I am playing around with the yfinance package (https://pypi.org/project/yfinance/) to learn Julia and ran into an issue with a parameter that is also a reserved word in Julia.
using PyCall
y = pyimport("yfinance")
data = y.download("SPY AAPL",…

Thomas
- 79
- 9
2
votes
0 answers
Connecting Julia to Weights & Biases over Python
I am trying to use weights&biases for my models written in Julia. I am using WeightsAndBiasLogger.jl and try to test their demo code:
using Logging, WeightsAndBiasLogger
args = (n_epochs=1_000, lr=1e-3)
logger =…

Bloxx
- 1,495
- 1
- 9
- 21