2018-computational-physics-course icon indicating copy to clipboard operation
2018-computational-physics-course copied to clipboard

Use linux-like julia in Windows

Open yuanchuanzou opened this issue 7 years ago • 2 comments

In Windows, Julia shell acts ugly when you are trying to deal with directories (cd, rm, ls, pwd...). There is a way to use linux-like julia without installing a new Linux system, or virtual system like virtualbox (BTW, these are also two methods, but not quite convenient for Windows users). Win10 contains Ubuntu!

Following are the steps:

  1. in Windows 10, goto Microsoft store (BTW, goto is already abandoned in the modern language :P ) find Ubuntu, and install it. I tested Ubuntu, and Ubuntu 18.04, both work.
  2. download julia for linux, https://julialang.org/downloads/ Best to download: Generic Linux Binaries for x86, for 64-bit (depend on your computer, maybe 32-bit) you will get the file "julia-1.0.0-linux-x86_64.tar.gz" in your download directory, say "Downloads"
  3. run Ubuntu, it prompts a shell.
  4. Move the downloaded file to your directory in Ubuntu. something like, :~/$ mv /mnt/c/Users/zouyc/Downloads/julia-1.0.0-linux-x86_64.tar.gz ./
  5. unzip the file :~/$tar xvzf julia-1.0.0-linux-x86_64.tar.gz You get everything you need!
  6. run it: :~/$./julia-1.0.0/bin/julia enjoy it!

An easier way to use it for the next time is: add "alias julia='~/Julia/julia-1.0.0/bin/julia' " to the end of the file ~/.bashrc next time, you don't need to give the absolute path of julia, just type 'julia' in the Bash.

yuanchuanzou avatar Sep 14 '18 20:09 yuanchuanzou

there are still driver issues with wsl, be careful with that in WSL(Windows Subsystem Linux). You might not be able to use some package in the future. Because wsl is not fully a Linux.

e.g: https://github.com/Microsoft/WSL/issues/1788

But feel free to file an issue there. And here is another reference for setting up the Julia in WSL.

https://discourse.julialang.org/t/fyi-julia-for-linux-on-bash-for-windows/3096

Roger-luo avatar Sep 14 '18 23:09 Roger-luo

yes. it might only be used for a lightweight usage. e.g., it doesn't support plot easily.

yuanchuanzou avatar Sep 15 '18 01:09 yuanchuanzou