# New to Julia

**URL:** https://discourse.julialang.org/c/first-steps/8.md?page=18

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 19

---

## [How to Maintain Consistent Julia Package Versions Across a Team - Julia & ModelingToolkit Versioning Issues – Best Practices?](https://discourse.julialang.org/t/how-to-maintain-consistent-julia-package-versions-across-a-team-julia-modelingtoolkit-versioning-issues-best-practices/127445)

<div class="topic-metadata">

**Author:** [@Niyas\_Navas](https://discourse.julialang.org/u/Niyas_Navas)\
**Replies:** 9\
**Last updated:** [March 28, 2025, 9:33pm UTC](https://discourse.julialang.org/t/how-to-maintain-consistent-julia-package-versions-across-a-team-julia-modelingtoolkit-versioning-issues-best-practices/127445 "2025-03-28T21:33:14Z")

</div>

Hello everyone, Our team has been working with Julia and ModelingToolkit.jl for a project, and after updating to the latest versions, we are facing issues. We are seeking guidance on: How to enforce specific package v…

---

## [PyCall import local package](https://discourse.julialang.org/t/pycall-import-local-package/127440)

<div class="topic-metadata">

**Author:** [@larstz](https://discourse.julialang.org/u/larstz)\
**Replies:** 0\
**Last updated:** [March 28, 2025, 9:16am UTC](https://discourse.julialang.org/t/pycall-import-local-package/127440 "2025-03-28T09:16:01Z")

</div>

Hi everyone, I’m having trouble importing a local Python package using PyCall in Julia. I have a working Python environment where I’ve successfully installed my local package with the command: pip install local\_package…

---

## [MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{DifferentiationInterface.FixTail{…}, Float64}, Float64, 3})](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-forwarddiff-dual-forwarddiff-tag-differentiationinterface-fixtail-float64-float64-3/127428)

<div class="topic-metadata">

**Author:** [@Emma00000](https://discourse.julialang.org/u/Emma00000)\
**Replies:** 2\
**Last updated:** [March 27, 2025, 7:03pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-float64-forwarddiff-dual-forwarddiff-tag-differentiationinterface-fixtail-float64-float64-3/127428 "2025-03-27T19:03:27Z")

</div>

Hi, I’m trying to find the steady states of a ODE system by FindSteadyStates.jl. using OrdinaryDiffEq, ODEInterfaceDiffEq, DifferentialEquations using ModelingToolkit, NonlinearSolve, FindSteadyStates @kwdef mutable st…

---

## [Help, I'm going out of my mind - Julia and VS Code Problems](https://discourse.julialang.org/t/help-im-going-out-of-my-mind-julia-and-vs-code-problems/27496)

<div class="topic-metadata">

**Author:** [@Monkspeed](https://discourse.julialang.org/u/Monkspeed)\
**Replies:** 27\
**Last updated:** [August 30, 2021, 3:57pm UTC](https://discourse.julialang.org/t/help-im-going-out-of-my-mind-julia-and-vs-code-problems/27496 "2021-08-30T15:57:47Z")

</div>

Hello all, I’ve installed VS Code, Julia 1.1.1, and setup the system variable JULIA\_HOME and path to point to the bin folder of Julia. julialang v0.12.0 is installed in VS Code. But every time I try to run my code with…

---

## [Help! Does anyone know how to use JuliaFormatter in VSCode editor?](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 8\
**Last updated:** [March 27, 2025, 5:01am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714 "2025-03-27T05:01:49Z")

</div>

Help! Does anyone know how to use JuliaFormatter in VSCode editor? I have installed JuliaFormater in VS Code editor but I don’t have a clue how to use it to format my Julia source code. Can anyone give me some instruct…

---

## [Von mises stress](https://discourse.julialang.org/t/von-mises-stress/127393)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 0\
**Last updated:** [March 26, 2025, 9:34pm UTC](https://discourse.julialang.org/t/von-mises-stress/127393 "2025-03-26T21:34:55Z")

</div>

Hi, I am using gridap in julia to find the vonMises stress. As it is for topology optimization I penalized the E for material distribution. It is working correctly when I have unifor material distribution but it is not s…

---

## [A matter of taste](https://discourse.julialang.org/t/a-matter-of-taste/127334)

<div class="topic-metadata">

**Author:** [@Soel](https://discourse.julialang.org/u/Soel)\
**Replies:** 18\
**Last updated:** [March 26, 2025, 3:27pm UTC](https://discourse.julialang.org/t/a-matter-of-taste/127334 "2025-03-26T15:27:32Z")

</div>

Hello dears, Would you please review the herebelow piece of code w.r.t the style, the way of doing things, performance-wise if possible… not necessarily task specific, but as a Julia programmer in general, how do you f…

---

## [CartesianIndex to an integer vector](https://discourse.julialang.org/t/cartesianindex-to-an-integer-vector/127338)

<div class="topic-metadata">

**Author:** [@seismobassoon](https://discourse.julialang.org/u/seismobassoon)\
**Replies:** 7\
**Last updated:** [March 26, 2025, 2:11pm UTC](https://discourse.julialang.org/t/cartesianindex-to-an-integer-vector/127338 "2025-03-26T14:11:06Z")

</div>

I have a simple question, rather esthetic than essential: I need to use CartesianIndex as an integer vector. The code below does work with “collect+Tuple” but collect, Vector alone did not. Do you have any idea? julia\> …

---

## [Redirecting stdout only redirects part of the output](https://discourse.julialang.org/t/redirecting-stdout-only-redirects-part-of-the-output/127379)

<div class="topic-metadata">

**Author:** [@MarcMiranda](https://discourse.julialang.org/u/MarcMiranda)\
**Replies:** 3\
**Last updated:** [March 26, 2025, 12:35pm UTC](https://discourse.julialang.org/t/redirecting-stdout-only-redirects-part-of-the-output/127379 "2025-03-26T12:35:03Z")

</div>

Good morning, I am using redirect\_stdout to redirect the ouput to a file “log.log”. However, only the part of printed statements using println() are being printed. However, a library I am importing uses display() and the…

---

## [Module names in module namespaces](https://discourse.julialang.org/t/module-names-in-module-namespaces/127365)

<div class="topic-metadata">

**Author:** [@rmfritz](https://discourse.julialang.org/u/rmfritz)\
**Replies:** 2\
**Last updated:** [March 26, 2025, 7:13am UTC](https://discourse.julialang.org/t/module-names-in-module-namespaces/127365 "2025-03-26T07:13:47Z")

</div>

Do I grasp correctly that a module’s name is contained in its own namespace?

---

## [Unable to run or debug when using VSCode](https://discourse.julialang.org/t/unable-to-run-or-debug-when-using-vscode/127325)

<div class="topic-metadata">

**Author:** [@ThermionicsGuy](https://discourse.julialang.org/u/ThermionicsGuy)\
**Replies:** 2\
**Last updated:** [March 25, 2025, 5:01pm UTC](https://discourse.julialang.org/t/unable-to-run-or-debug-when-using-vscode/127325 "2025-03-25T17:01:51Z")

</div>

Using: Windows 11 Julia 1.11.4 Visual Studio Code 1.98.2 julialang extension 1.127.2 I get an error message whenever I try to run any code from VSCode if it contains a user-defined function. Here’s an example I thre…

---

## [IPNewton (suddenly) fails on trivial example](https://discourse.julialang.org/t/ipnewton-suddenly-fails-on-trivial-example/127337)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 2\
**Last updated:** [March 25, 2025, 1:26pm UTC](https://discourse.julialang.org/t/ipnewton-suddenly-fails-on-trivial-example/127337 "2025-03-25T13:26:48Z")

</div>

Hi, I’ve ran into a problem where interior-point newton fails on the following easy example: using ForwardDiff, Optim norm\_c!(c, x) = (c\[1\] = sum(y -\> y^2, x); c) constraints(d) = TwiceDifferentiableConstraints(norm\_c…

---

## [MIPLearn.BasicCollector() error why](https://discourse.julialang.org/t/miplearn-basiccollector-error-why/127335)

<div class="topic-metadata">

**Author:** [@daiyucan](https://discourse.julialang.org/u/daiyucan)\
**Replies:** 0\
**Last updated:** [March 25, 2025, 7:43am UTC](https://discourse.julialang.org/t/miplearn-basiccollector-error-why/127335 "2025-03-25T07:43:16Z")

</div>

code running ok until to -4-5-part using MIPLearn.BasicCollector() collect data error :The terminal process "julia ‘-i’,‘–banner=no’,“project=C:\\Userslxx,julialenvironmentslv1.11’‘c:\\Users\\xx.vscodelextensionsyjulialan…

---

## [Achieving Maximum Algebraic Simplification in Symbolic Computation](https://discourse.julialang.org/t/achieving-maximum-algebraic-simplification-in-symbolic-computation/127288)

<div class="topic-metadata">

**Author:** [@theo.bruelhart](https://discourse.julialang.org/u/theo.bruelhart)\
**Replies:** 2\
**Last updated:** [March 24, 2025, 8:55pm UTC](https://discourse.julialang.org/t/achieving-maximum-algebraic-simplification-in-symbolic-computation/127288 "2025-03-24T20:55:54Z")

</div>

Observation The result of the mathematical operation (see code section) is not in its simplest algebraic form. Obtained results: \[(1//2)\*√(4y), (-1//2)\*√(4y)\] Expected result: \[√(y), -√(y)\] Question Does anyone have…

---

## [Modélisation de la taxe carbone](https://discourse.julialang.org/t/modelisation-de-la-taxe-carbone/127306)

<div class="topic-metadata">

**Author:** [@omar\_diouf](https://discourse.julialang.org/u/omar_diouf)\
**Replies:** 4\
**Last updated:** [March 24, 2025, 4:20pm UTC](https://discourse.julialang.org/t/modelisation-de-la-taxe-carbone/127306 "2025-03-24T16:20:28Z")

</div>

Bonjour cher communauté, je suis nouveau dans julia et j’aimerais avoir un code gams sur la modélisation du secteur de l’énergie afin de faciliter la compréhension du code julia. Merci

---

## [Strange type constructor quirk](https://discourse.julialang.org/t/strange-type-constructor-quirk/127265)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 7\
**Last updated:** [March 24, 2025, 12:26pm UTC](https://discourse.julialang.org/t/strange-type-constructor-quirk/127265 "2025-03-24T12:26:31Z")

</div>

\*Edit: changed title to be more accurate Hi, everyone. So, I\`m not exactly new to julia but this feels like it belongs here as it is quite basic and still puzzles me. Let’s consider the MWE in following code snippet: s…

---

## [Sundials solution greatly deviates for large perturbation, why?](https://discourse.julialang.org/t/sundials-solution-greatly-deviates-for-large-perturbation-why/127147)

<div class="topic-metadata">

**Author:** [@dsousoun](https://discourse.julialang.org/u/dsousoun)\
**Replies:** 12\
**Last updated:** [March 24, 2025, 10:13am UTC](https://discourse.julialang.org/t/sundials-solution-greatly-deviates-for-large-perturbation-why/127147 "2025-03-24T10:13:05Z")

</div>

Hello all, First of, I am sorry for the massive code text. The problem: in the following for small enough perturbations in P\_in (ie jump = 1e-2), the IDA solver matches perfectly my solver. However, for anything larger…

---

## [Using Symbolics & Nemo; Unexpected roots of simple 2nd degree polynomial equation](https://discourse.julialang.org/t/using-symbolics-nemo-unexpected-roots-of-simple-2nd-degree-polynomial-equation/127281)

<div class="topic-metadata">

**Author:** [@theo.bruelhart](https://discourse.julialang.org/u/theo.bruelhart)\
**Replies:** 2\
**Last updated:** [March 23, 2025, 8:10pm UTC](https://discourse.julialang.org/t/using-symbolics-nemo-unexpected-roots-of-simple-2nd-degree-polynomial-equation/127281 "2025-03-23T20:10:40Z")

</div>

\[Issue\] Unexpected roots of simple 2nd degree polynomial equation using Symbolics.jl and Nemo.jl Obtained results: \[(1//2)\*√(4y), (-1//2)\*√(4y)\] Expected result: \[√(y), -√(y)\] \[Environment\] Linux thinkpad 6.1.0-32-…

---

## [Is matrix multiplication not associative?](https://discourse.julialang.org/t/is-matrix-multiplication-not-associative/127231)

<div class="topic-metadata">

**Author:** [@Yeguarr](https://discourse.julialang.org/u/Yeguarr)\
**Replies:** 22\
**Last updated:** [March 23, 2025, 2:11am UTC](https://discourse.julialang.org/t/is-matrix-multiplication-not-associative/127231 "2025-03-23T02:11:43Z")

</div>

Hi! I have a very simple code snippet: let B = \[1;1\] K = \[1 2\] x = \[1;2\] (B\*K)\*x #Works fine B\*(K\*x) #MethodError: no method matching \*(::Vector{Int64}, ::Vector{Int64}) end It seems that Julia automatically conv…

---

## [Yet another "how to pass multiple parameters to a function" post](https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095)

<div class="topic-metadata">

**Author:** [@Boris](https://discourse.julialang.org/u/Boris)\
**Replies:** 7\
**Last updated:** [March 21, 2025, 5:33pm UTC](https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095 "2025-03-21T17:33:05Z")

</div>

Apologies for the n-th post on this topic (#1, #2, #3, etc. etc).I simply don’t get it and feel overwhelmed by all choices of how to pass parameters to a function (positional arguments, optional keyword arguments, named …

---

## [Interior-Point Newton tries points outside of the constraint set](https://discourse.julialang.org/t/interior-point-newton-tries-points-outside-of-the-constraint-set/127215)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 5\
**Last updated:** [March 21, 2025, 2:12pm UTC](https://discourse.julialang.org/t/interior-point-newton-tries-points-outside-of-the-constraint-set/127215 "2025-03-21T14:12:59Z")

</div>

Hi, I’m using Interior-Point Newton to solve a constrained optimization problem where my objective function is not (always) defined outside the constraint set. I found that Interior-Point Newton sometimes tries points ou…

---

## [About module importation](https://discourse.julialang.org/t/about-module-importation/127164)

<div class="topic-metadata">

**Author:** [@Gesee](https://discourse.julialang.org/u/Gesee)\
**Replies:** 5\
**Last updated:** [March 20, 2025, 10:40pm UTC](https://discourse.julialang.org/t/about-module-importation/127164 "2025-03-20T22:40:17Z")

</div>

If I have a module A importing a package B and a module C importing the package B, How can do to import the module B only one time so that module A and module C can use it

---

## [No allocs after restart](https://discourse.julialang.org/t/no-allocs-after-restart/117273)

<div class="topic-metadata">

**Author:** [@freeman](https://discourse.julialang.org/u/freeman)\
**Replies:** 14\
**Last updated:** [March 20, 2025, 9:29pm UTC](https://discourse.julialang.org/t/no-allocs-after-restart/117273 "2025-03-20T21:29:50Z")

</div>

First off let me say that I realize it’s a long shot that someone can help me because I’m not providing minimal working example. However I’m hoping that this will sound familiar to someone. I’ve make all my code entirel…

---

## [Problem with DifferentialEquations.jl](https://discourse.julialang.org/t/problem-with-differentialequations-jl/127184)

<div class="topic-metadata">

**Author:** [@Name\_Family\_Name](https://discourse.julialang.org/u/Name_Family_Name)\
**Replies:** 3\
**Last updated:** [March 20, 2025, 6:46pm UTC](https://discourse.julialang.org/t/problem-with-differentialequations-jl/127184 "2025-03-20T18:46:08Z")

</div>

I’m working on a project, which is basically a simulation model for adsorption process of phosphate in waste water (2 videos to understand the adsorption process, it’s 15 seconds in total) So the first is to simulate t…

---

## [WebSocket and HTTP fails silently](https://discourse.julialang.org/t/websocket-and-http-fails-silently/127109)

<div class="topic-metadata">

**Author:** [@\_admin](https://discourse.julialang.org/u/_admin)\
**Replies:** 5\
**Last updated:** [March 20, 2025, 12:19pm UTC](https://discourse.julialang.org/t/websocket-and-http-fails-silently/127109 "2025-03-20T12:19:50Z")

</div>

Straight to the code, HTTP and WebSocket in Julia can’t establish a connection. It seem to be a general error with Julia or the package. I’m using the latest versions on mac. julia version 1.11.4 Minimal Example using…

---

## [MLStyle - are recursive ADTs possible](https://discourse.julialang.org/t/mlstyle-are-recursive-adts-possible/127083)

<div class="topic-metadata">

**Author:** [@jonoke](https://discourse.julialang.org/u/jonoke)\
**Replies:** 10\
**Last updated:** [March 19, 2025, 9:05pm UTC](https://discourse.julialang.org/t/mlstyle-are-recursive-adts-possible/127083 "2025-03-19T21:05:32Z")

</div>

Hi, I’m playing around with MLStyle but can’t seem to get a definition for a cons list to work. If I try: @data XX{T} begin Nil Cons(hd::T, tl::XX{T}) end I get: ERROR: LoadError: Defining generic enum Nil \<:…

---

## [Select specific elements from each column of a matrix in julia](https://discourse.julialang.org/t/select-specific-elements-from-each-column-of-a-matrix-in-julia/127138)

<div class="topic-metadata">

**Author:** [@alex180500](https://discourse.julialang.org/u/alex180500)\
**Replies:** 4\
**Last updated:** [March 19, 2025, 6:24pm UTC](https://discourse.julialang.org/t/select-specific-elements-from-each-column-of-a-matrix-in-julia/127138 "2025-03-19T18:24:16Z")

</div>

Let’s say I have this 16x1000 matrix: test\_mat = rand(16, 1000) And I have these indices: test\_indices = rand(1:16, 4, 1000) I want to extract from test\_mat a 4x1000 matrix where the indices of the row are represente…

---

## [Rewrite a for loop using dot](https://discourse.julialang.org/t/rewrite-a-for-loop-using-dot/127099)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 4\
**Last updated:** [March 19, 2025, 6:22am UTC](https://discourse.julialang.org/t/rewrite-a-for-loop-using-dot/127099 "2025-03-19T06:22:11Z")

</div>

Hi, there. I’m not sure if I can equivalently rewrite a for-loop, with the help of the dot syntax. Here “equivalently” is in terms of both the logical executing sequence, and performance. When looking at the code, the …

---

## [+ for Unit Range. Is my REPL broken?](https://discourse.julialang.org/t/for-unit-range-is-my-repl-broken/127112)

<div class="topic-metadata">

**Author:** [@Eventine](https://discourse.julialang.org/u/Eventine)\
**Replies:** 12\
**Last updated:** [March 18, 2025, 9:54pm UTC](https://discourse.julialang.org/t/for-unit-range-is-my-repl-broken/127112 "2025-03-18T21:54:12Z")

</div>

Is this really not there: methods(+,(UnitRange{Int},Int)) # 0 methods for generic function "+" from Base or is my local REPL broken? This is what I had to add: Base.:(+)(r::AbstractRange{T}, x::Real) where {T\<:Real} …

---

## [Writing excel from dataframes](https://discourse.julialang.org/t/writing-excel-from-dataframes/126932)

<div class="topic-metadata">

**Author:** [@emt85](https://discourse.julialang.org/u/emt85)\
**Replies:** 7\
**Last updated:** [March 18, 2025, 12:17am UTC](https://discourse.julialang.org/t/writing-excel-from-dataframes/126932 "2025-03-18T00:17:31Z")

</div>

Hi… I am somewhat new to julia and am still learning how to play around with data. I feel more comfortable with excel and want to export my dataframes into an excel sheet. I followed this template: XLSX.writetable( “f…

[Previous page](https://discourse.julialang.org/c/first-steps/8.md?page=17)

[Next page](https://discourse.julialang.org/c/first-steps/8.md?page=19)
