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

Fail to include Julia file in a python script through the Main.include function #189

Closed
ywlds opened this issue Jun 23, 2022 · 1 comment

Comments

@ywlds
Copy link

ywlds commented Jun 23, 2022

Python 3.7.13 (default, Mar 29 2022, 02:18:16)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

import juliacall
juliacall.Main.include("/opt/tiger/DMET/utlis/test_gpu.jl")
Traceback (most recent call last):
File "", line 1, in
File "/home/tiger/.julia/packages/PythonCall/91RyA/src/jlwrap/any.jl", line 201, in call
return self.jl_callmethod($(pyjl_methodnum(pyjlany_call)), args, kwargs)
juliacall.JuliaError: SystemError: opening file "/opt/tiger/DMET/utlis/test_gpu.jl": No such file or directory
Stacktrace:
[1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
@ Base ./error.jl:174
[2] #systemerror#68
@ ./error.jl:173 [inlined]
[3] systemerror
@ ./error.jl:173 [inlined]
[4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
@ Base ./iostream.jl:293
[5] open
@ ./iostream.jl:282 [inlined]
[6] open(f::Base.var"#364#365"{String}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./io.jl:328
[7] open
@ ./io.jl:328 [inlined]
[8] read
@ ./io.jl:436 [inlined]
[9] include(mapexpr::Function, mod::Module, path::String)
@ Base ./loading.jl:1249
[10] include(fname::String)
@ Base.MainInclude ./client.jl:451
[11] pyjlany_call(self::typeof(include), args
::PythonCall.Py, kwargs
::PythonCall.Py)
@ PythonCall ~/.julia/packages/PythonCall/91RyA/src/jlwrap/any.jl:31
[12] pyjl_callmethod(f::Any, self::Ptr{PythonCall.C.PyObject}, args
::Ptr{PythonCall.C.PyObject}, nargs::Int64)
@ PythonCall ~/.julia/packages/PythonCall/91RyA/src/jlwrap/base.jl:69
[13] _pyjl_callmethod(o::Ptr{PythonCall.C.PyObject}, args::Ptr{PythonCall.C.PyObject})
@ PythonCall.C ~/.julia/packages/PythonCall/91RyA/src/cpython/jlwrap.jl:47
juliacall.Main.include("/opt/tiger/DMET/utils/test_gpu.jl")
Error processing line 1 of /home/tiger/.local/lib/python3.7/site-packages/google_api_core-1.31.5-py3.8-nspkg.pth:

Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
File "/home/tiger/anaconda3/lib/python3.7/site.py", line 168, in addpackage
exec(line)
File "", line 1, in
File "/home/tiger/anaconda3/lib/python3.7/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/home/tiger/anaconda3/lib/python3.7/contextlib.py", line 5, in
from collections import deque
File "/home/tiger/anaconda3/lib/python3.7/collections/init.py", line 24, in
import heapq as _heapq
File "/home/tiger/anaconda3/lib/python3.7/heapq.py", line 587, in
from _heapq import *
SystemError: initialization of _heapq did not return an extension module

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/tiger/anaconda3/lib/python3.7/site.py", line 579, in
main()
File "/home/tiger/anaconda3/lib/python3.7/site.py", line 565, in main
known_paths = addusersitepackages(known_paths)
File "/home/tiger/anaconda3/lib/python3.7/site.py", line 315, in addusersitepackages
addsitedir(user_site, known_paths)
File "/home/tiger/anaconda3/lib/python3.7/site.py", line 207, in addsitedir
addpackage(sitedir, name, known_paths)
File "/home/tiger/anaconda3/lib/python3.7/site.py", line 178, in addpackage
import traceback
File "/home/tiger/anaconda3/lib/python3.7/traceback.py", line 3, in
import collections
File "/home/tiger/anaconda3/lib/python3.7/collections/init.py", line 24, in
import heapq as _heapq
File "/home/tiger/anaconda3/lib/python3.7/heapq.py", line 587, in
from _heapq import *
SystemError: initialization of _heapq did not return an extension module

@cjdoris
Copy link
Collaborator

cjdoris commented Jun 30, 2022

juliacall.JuliaError: SystemError: opening file "/opt/tiger/DMET/utlis/test_gpu.jl": No such file or directory

You have a typo in the file name?

@cjdoris cjdoris closed this as completed Jul 2, 2022
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

2 participants