Hello! I’m using Julia 1.4.
I’m trying to make a Python program which calls upon Julia using [PyJulia] (GitHub - JuliaPy/pyjulia: python interface to julia) and calls a .jl file I have stored in the same directory. This file uses a few installed Julia packages such as LsqFit and Statistics (installed via the REPL). However, whenever I run the Python program, Julia thinks I haven’t installed LsqFit when I very clearly have (it’s in Project.toml).
The error and stacktrace is below:
C:\ProgramData\Anaconda3\lib\site-packages\julia\core.py:689: FutureWarning: Accessing `Julia().<name>` to obtain Julia objects is deprecated. Use `from julia import Main; Main.<name>` or `jl = Julia(); jl.eval('<name>')`.
FutureWarning,
Traceback (most recent call last):
File "main.py", line 156, in <module>
main()
File "main.py", line 123, in main
Main.include("processor/concentration.jl")
ImportError: Julia exception: LoadError: ArgumentError: Package LsqFit not found in current path:
- Run `import Pkg; Pkg.add("LsqFit")` to install the LsqFit package.
Stacktrace:
[1] require(::Module, ::Symbol) at .\loading.jl:876
[2] include at .\boot.jl:328 [inlined]
[3] include_relative(::Module, ::String) at .\loading.jl:1094
[4] include(::Module, ::String) at .\Base.jl:31
[5] include(::String) at .\client.jl:431
[6] #invokelatest#1 at .\essentials.jl:790 [inlined]
[7] invokelatest(::Any, ::Any) at .\essentials.jl:789
[8] _pyjlwrap_call(::Function, ::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}) at C:\Users\user\.julia\packages\PyCall\ttONZ\src\callback.jl:28
[9] pyjlwrap_call(::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}) at C:\Users\user\.julia\packages\PyCall\ttONZ\src\callback.jl:49
in expression starting at C:\Users\user\Downloads\fpga-scan-and-fit-master\fpga-scan-and-fit-master\processor\concentration.jl:1
Any help whatsoever would be greately appreciated!