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

Possible spurious FutureWarning #497

Open
jolars opened this issue May 10, 2022 · 0 comments
Open

Possible spurious FutureWarning #497

jolars opened this issue May 10, 2022 · 0 comments

Comments

@jolars
Copy link

jolars commented May 10, 2022

Please consider this code:

from julia import Julia

jl = Julia()
jl.eval("1 + 1")
#> [...]/.pyenv/versions/3.9.10/lib/python3.9/site-packages/julia/core.py:703: FutureWarning: Accessing `Julia().<name>` to obtain Julia objects is deprecated.  Use `from julia import Main; Main.<name>` or `jl = Julia(); jl.eval('<name>')`.
#>   warnings.warn(
#> 2

I don't understand why there's an error here since I'm in fact using one of the recommended options from the warning above.

Using the first option works fine however:

from julia import Main

Main.eval("1 + 1")
#> 2
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

1 participant