Hi everyone, I hope you’re doing well, I’m new to Julia and I’m having problems using Julia.
I have a 2022 MacBook Air that works with an M2 chip, I have installed an uninstalled Julia many times. I understand that due to the characteristics of my computer, I must install the program using the Apple Silicon option along with “.dmg”. When trying to work with Jupyter, first it happened that there were certain packages that it didn’t recognize, that it said were not defined, which seemed strange to me, because I had already imported them correctly. Today I uninstalled an installed Julia again with version v1.11.0 from october 7,2024 and it happens that when I try to run the program, it says that the kernel died and it will restart automatically, but that doesn’t happen, it just stays stuck, I checked the kernel options and some of them appear from other times that I installed Julia, but the one from the version that I installed today doesn’t appear.
I don’t know if it’s relevant, maybe the versions work the same, because I opened Jupiter from the Julia terminal, and what I understand, this is how you link Julia in the Jupiter kernel. Another thing that seemed strange to me is that when I went back to install Julia (I had already deleted the version of Julia that was installed on my computer, which if I’m not mistaken was the 10.4) and install the IJulia package, something appeared like there were no changes and it didn’t install all the things that it’s supposed to install when doing everything first time, and the other times that I uninstalled and installed the program again it did it, I don’t know if I explain myself hahaha.
Also, I installed Julia on someone else’s computer, which is a much older MacBook Air, and I installed the packages in the same way as I had done on my computer and everything worked correctly there, so I don’t understand what might be failing on my computer.
I’ve tried to solve this problem in many ways and I still can’t, I ask you to please help me. I’m from Chile, so my english isn’t that good, so sorry in advance if something that I wrote was not understood hahahaha.
I believe the current officially-recommended installation method is to use an installer called juliaup
: GitHub - JuliaLang/juliaup: Julia installer and version multiplexer.
At the top of this page (julialang.org) there should be a box that provides platform-specific guidance. On macOS it recommends running a particular curl
command that will install and configure a copy for you. The juliaup
tools also serves as a convenient manager for keeping your installation up to date without having to manually reinstall anything.
Can you clarify/check if the problem occurs only in Jupyter notebooks, or already with Julia itself? I.e. if you just use Julia in a terminal, does everything work fine?
Here is my suggestion
-
step 1 delete anything related to julia,
- go to your home directory
- press
cmd + shift + .
- delete the directory named
.julia
- Also make sure you delete any julia apps in your
Applications
directory
-
step 2 install juliaup
curl -fsSL https://install.julialang.org | sh
-
step 3 add julia 1.10.5
juliaup add lts
orjuliaup add 1.10
-
step 4 add
IJulia
julia
- press
]
- type
add IJulia
Yes, in Julia everything works fine. The problem is Jupyter, the problem starts when I try to work with JuMP and Cbc, being more specific, when I write the code “model=Model(Cbc.Optimizer)” (having imported JuMP and Cbc before) and then it shows the message “The kernel for Downloads/Actividad 5.2.ipynb appears to have died. It will restart automatically.”
that’s how I installed julia this morning, but it still not working
I’ve just realized that the problem may be in Julia, because I imported JuMP and Cbc in the Julia terminal, and then I tried to run the code " m = Model(Cbc.Optimizer)" and it showed an error message "julia(25618,0x1024f8580) malloc: *** error for object 0xe00000000000000: pointer being freed was not allocated
julia(25618,0x1024f8580) malloc: *** set a breakpoint in malloc_error_break to debug
[25618] signal 6: Abort trap: 6
in expression starting at REPL[10]:1
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 29411347 (Pool: 29408963; Big: 2384); GC: 64
zsh: abort julia". Do you know something about this?
I don’t think Cbc supports apple silicon: Support for Apple M1 · Issue #193 · jump-dev/Cbc.jl · GitHub. I would use HiGHs instead (About · HiGHS Documentation)