I open a folder and get in the terminal just: PS D\andSoOn_theFolderPath >
To get to Julia (if one can say it like that) I have to run a lin of code of a program in my folder, what am I doing wrong?
If I set my Julia environment in the left corner of VSCode to anything else than my current folder I get the error (That occurs in many other questions as well): Julia package not part of your current environment. Is that bad? It seems to run that way, kind of.
my Path is for example this folder saved somewhere
From the question:
All I wanted is to run a Julia file, thats it. The example I tried is the link (PowerModels, but any would work for me, I just need an example), it does have a Project and Manifest file. I am in the right path, I guess, and I did activate and instantiated (what I think is the current folder with those files).
So to back up to the absolut beginning in VS Code: “File” → “Open Folder” and my Terminal Commant line shows PS D:\Daten\Julia\PowerModels.jl-master>
(… the cd(“D:\Daten\Julia\PowerModels.jl-master”) command then does nothing, right? But I should be in the working directory) I can change the environment in the left corner of VSCode and chose “C:\users\myName.julia\environments\v1.7”, but that doesnt help … and typing in “using Pkg” doesnt work in any case.
Runing one line of Code by Ctrl+enter in a file in that folder starts Julia and I can type in using Pkg and then activate and so on…
That cant be the way, right?
But that is also another problem due to inexperience, I hope.
I just want to run the Code, shown in the read me:
Basic Usage
Once PowerModels is installed, Ipopt is installed, and a network data file (e.g. “nesta_case3_lmbd.m”) has been acquired, an AC Optimal Power Flow can be executed with,
using PowerModels using Ipopt run_ac_opf(“nesta_case3_lmbd.m”, IpoptSolver())
I have, but I will dig deeper, my specific Problem is posted as an answer to PetrKrysIUCSD here in this discussion, maybe thet helps to clarify. But I will dig deeper.
The way I try it seems just too hard for just running code.
That is the PowerShell terminal, nothing to do with Julia. What you are looking for is the REPL (which shows the julia> prompt), and you have to start it manually. That can be done in (at least) three ways:
a. Run the command “Julia: Start REPL” (from the command palette: Ctrl+Shift+P).
b. Default keybinding: Alt+J, Alt+O.
c. Run some code in the editor (the way you actually did it).
Well, I open a normal terminal in vscode and start julia from that terminal… Faster and easier for me than using the Julia REPL from vscode…
And to run an example I just use the command
Yes, that works, but other components of the VS Code Julia extension (inline execution, variable explorer, plot panel, automatic recognition of sysimage…) won’t be linked to what you do in that terminal. That’s ok if you like it like that, but may be confusing for new users who have read about those features.
there is not. Nice that you looked that up, but it was just an example and does therefore not tackle the main problem.
The new Version does look very interesting though, thx.
Well, I do have a set file folder, structure
Folder(Project,Manifest,src(file1,file2),examples(example1,example2)).
I cannot just klick in examples, in example1 and go to “Run”.
include(“examples/example1.jl”) does not work, e.g. this and a 100 other Errors occur:
ERROR: LoadError: UndefVarError: VariablesContainer not defined