Comments (7)
Fixed by PythonCall transition
from diffeqpy.
@tkf do you know anything about this?
from diffeqpy.
I think it means that IPython cannot find command line program julia
inside Jupyter.
To check if IPython can find julia
, you can run !which julia
(with !
) inside Jupyter. If it says julia not found
or sometihng similar, you need to specify the path to julia
explicitly when using PyJulia. To find out the absolute path to julia
, you can do which julia
(no !
here) in the system shell (e.g., bash
). Once you get the path, you can then do
from julia import Julia
Julia(runtime="PATH/TO/bin/julia")
from diffeqpy import de
with PATH/TO/bin/julia
replaced with the actual path printed by which julia
.
Ref: https://pyjulia.readthedocs.io/en/latest/api.html
from diffeqpy.
!which julia
resulted in:
which julia julia
/usr/local/bin/julia
/usr/local/bin/julia
What seems to work is:
from julia.api import Julia
jl = Julia(compiled_modules=False)
#jl(runtime="/usr/local/bin/julia")
from diffeqpy import de
However it takes quite a long time to import the package...
from diffeqpy.
Do you get the same stacktrace as in the first post if you:
- Restart the IPython kernel, and then
- Evaluate
from julia import Main
?
from diffeqpy.
I've restarted the Kernel and used:
import time
start = time.time()
from julia import Main
end = time.time()
print(end - start)
But I have got FileNotFoundError
:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-4-d6cf9f272d96> in <module>
1 import time
2 start = time.time()
----> 3 from julia import Main
4 end = time.time()
5 print(end - start)
/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in _find_and_load(name, import_)
/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in _load_unlocked(spec)
/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in _load_backward_compatible(spec)
/opt/anaconda3/lib/python3.7/site-packages/julia/core.py in load_module(self, fullname)
244 if juliapath == 'Main':
245 return sys.modules.setdefault(fullname,
--> 246 JuliaMainModule(self, fullname))
247 elif self.julia.isafunction(juliapath):
248 return self.julia.eval(juliapath)
/opt/anaconda3/lib/python3.7/site-packages/julia/core.py in __init__(self, loader, *args, **kwargs)
146 def __init__(self, loader, *args, **kwargs):
147 super(JuliaModule, self).__init__(*args, **kwargs)
--> 148 self._julia = loader.julia
149 self.__loader__ = loader
150
/opt/anaconda3/lib/python3.7/site-packages/julia/core.py in julia(self)
236 @property
237 def julia(self):
--> 238 self.__class__.julia = julia = Julia()
239 return julia
240
/opt/anaconda3/lib/python3.7/site-packages/julia/core.py in __init__(self, init_julia, jl_init_path, runtime, jl_runtime_path, debug, **julia_options)
465 self.api = get_libjulia()
466 elif init_julia:
--> 467 jlinfo = JuliaInfo.load(runtime)
468 if jlinfo.version_info < (0, 7):
469 raise RuntimeError("PyJulia does not support Julia < 0.7 anymore")
/opt/anaconda3/lib/python3.7/site-packages/julia/juliainfo.py in load(cls, julia, **popen_kwargs)
71 stderr=subprocess.PIPE,
72 universal_newlines=True,
---> 73 **popen_kwargs
74 )
75
/opt/anaconda3/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
798 c2pread, c2pwrite,
799 errread, errwrite,
--> 800 restore_signals, start_new_session)
801 except:
802 # Cleanup if the child failed starting.
/opt/anaconda3/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
1549 if errno_num == errno.ENOENT:
1550 err_msg += ': ' + repr(err_filename)
-> 1551 raise child_exception_type(errno_num, err_msg, err_filename)
1552 raise child_exception_type(err_msg)
1553
FileNotFoundError: [Errno 2] No such file or directory: 'julia': 'julia'
from diffeqpy.
Hi,
I get the same problem. Could you help me, please?
Thanks!
from diffeqpy.
Related Issues (20)
- How to make it use of FractionalDiffEq.jl into python - reg HOT 1
- question: is this repository still under maintain? HOT 3
- Sparse Matrix Jacobian / Mass Matrix support HOT 2
- MethodError: no method matching Sundials.NVector(::Vector{Real}) HOT 3
- Terminating integration based on maxiters results in RuntimeError HOT 3
- problems with julia 1.9? HOT 2
- Speed up julia loading and time to first run HOT 1
- Feature request: Ingest sympy representation of ModelingToolkit and return PyTorch tensor with gradients and events
- dictionary support for de.jit HOT 7
- Support prob_func in ensembles HOT 5
- diffeqpy GPU isn't automatically installing DiffEqGPU on Collab? HOT 2
- Segfault when using sympy symbols as initial conditions.
- UndefVarError: NonlinearLeastSquaresProblem not defined in SimpleNonlinearSolve package HOT 2
- LoadError: Artifact "OpenSpecFun" was not found by looking in the paths HOT 3
- Precompilation not quite working HOT 2
- Error when importing de HOT 9
- TypeError on DiscreteCallback HOT 2
- Error when running the example code for GPU-acceleration using diffeqpy HOT 10
- DAE with Mass Matrix HOT 7
- Error when import the "de" from the "diffeqpy" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diffeqpy.