Closed mwermelinger closed 1 year ago
Hi Michel,
I have begun the process of downloading the m269 software using the WSL system on Windows 11. I chose to store the M269-23j folder in WSL using cd /mnt/...
.
My first installation of the software seemed to finish successfully but as i moved on i realised there was an issue. I noticed there was a message prompting me to install the package python3.10-venv
, so i followed the advice by entering sudo apt install python3.10-venv
. I then went back to the installation steps and installed the software again which was successful.
I was then able to enter the M269 folder and the command prompt line became (m269-23j)...
. However, when i tried to access the notebooks using nb
i received this error:
ls: cannot access '/home/cameronscott/OU/M269-23j/book-r*': No such file or directory [C 20:32:48.146 NotebookApp] No such file or directory: /notebooks/M269.ipynb
I called it a day after i received that error but i plan to revisit this tonight.
I was also wondering if it would be beneficial if i were to post the specs of my PC? I will be running these tests on my laptop and desktop as they run on different Windows OS.
Thanks Cameron
I was then able to enter the M269 folder and the command prompt line became
(m269-23j)...
. However, when i tried to access the notebooks usingnb
i received this error:ls: cannot access '/home/cameronscott/OU/M269-23j/book-r*': No such file or directory [C 20:32:48.146 NotebookApp] No such file or directory: /notebooks/M269.ipynb
Hi Cameron,
It looks like you haven't downloaded the notebook yet. Here's the relevant bit from the instructions:
You should have these files/folders in the M269-23J folder:
To copy the book in, you can run file explorer from the WSL terminal and copy in the folder from Windows:
After you've added the book folder run nb
and you'll see this:
Then control+click on one of the links at the bottom (eg. http://localhost....) to open the notebooks in your browser
@mwermelinger I get permissions errors when opening the notebooks, so they are read only:
I believe this is to do with copying files from Windows to WSL via explorer.exe
Yeah, you have to copy in the files via the WSL terminal to avoid the permissions issues:
Although, to be honest, this install process on Windows actually seems more involved than the Anaconda one we used in 22J...
I got the notebooks to work. Thank you Daniel for pointing out my obvious overlook!
Could we create a clearer instruction for putting the notebooks in the M269 folder? The instruction could be added into the installation section of the instruction guide and could look something like this:
1. To access the notebooks, you will need to download the M269 book from the resources tab on the M269 site and install it into the folder you have created.
I completed the installation process on Windows 10 and i never had the same read only issue when copying the book files into the M269 folder, although i encountered a different issue when trying to install WSL. The command prompt indicated that i did not have virtualisation enabled which seems to be the default option.
This required turning the SVM feature (i think its GVT for Intel) on in my BIOS and enabling Hyper -V in my Windows optional features, which was simple enough to do but it added length to the installation process.
Cameron, Daniel, many many thanks for trying it out and all the feedback! Apologies for not replying sooner.
I'll make the instructions about installing the notebooks clearer, as an explicit step.
nb
command automatically open the browser with the cover notebook?wsl
command?It seems that if we iron out these issues to make instructions for Windows clearer, then we'll have the same environment for everyone and equal to JupyterHub, at the expense that installing WSL is a bit more hassle than installing Anaconda. Thanks again.
Forgot to ask: which exact Windows versions did you use? And have you run a couple of notebook cells to check if it was working?
One addendum:
I think it may be better if the M269 folder is in the Windows filesystem so that the folder can be in a cloud drive and so that the PDF and HTML versions of the book can be accessed without going through WSL. Would you agree?
Hi Michel, apologies for the late reply i have been away on holiday!
I have opened the notebooks and worked through a couple of sections to make sure they were working ok. I had no issues when using the notebooks but the only issue i can see is that the nb
command does not automatically open the notebooks, i had to copy the link into my browser and open them from there.
NOTE: This issue only occurs on my laptop that uses Windows 11.
I had to install the venv package when trying to install the m269.sh
file. I found it weird as well, i would have though python3.10 would come with it. I have done the installation process twice on Windows 11 though and had the same prompt!
As soon as i tried to install WSL i was prompted to enable Virtualisation and Hyper -V, the steps to do so are as follows:
NOTE: This only occured on my desktop when installing on Windows 10.
F7
or clicking on it in the bottom right corner.NOTE: The nomenclature may change with different laptop/desktop models and configurations.
When the installation has completed you are prompted to restart your computer.
I have the M269 folder in the WSL file system and had no read only issues. Trying to install the M269 folder in the Windows file system but it seems to keep finding itself in WSL. Feeling a little bit silly and think i may be missing something! I agree that having the folder in the Windows filesystem would be the best option because it can be backed up in a cloud drive, as you said.
@cameron-s-scott , @mwermelinger on Windows 10 running WSL version 1 in virtualbox, I had the same venv
issues. It seems like the default installation of Ubuntu (used by WSL) does not have this package or has an outdated version.
I would recommend either adding a new instruction for WSL users (who have a Debian based distro) to
sudo apt update
sudo apt upgrade
sudo apt install python3.10-venv
or somehow test for a Debian based distro and incorporate it into the script.
EDIT: It looks like WSL sets a WSL_DISTRO_NAME
environment variable. This means it is relatively straightforward to test if user is on WSL and which distro they are using.
RE browser not automatically opening Jupyter notebooks: I was also having the same issue and managed to get around it by using wslu
(link here) and setting the BROWSER
environment variable. wslu
is a collection of WSL utilities and is available via the standard package manager (apt) in Ubuntu. A useful thing to know would be: is it really necessary to set the BROWSER
environment variable in addition to installing wslu
? I did them both at the same time which worked, but then subsequently removed the environment variable and it still worked. This means I am not 100% sure it is necessary to set the environment variable to get it working.
wslu
can be installed with
sudo apt install wslu
and the environment variable can be set permanently by adding
export BROWSER=wslview
To your ~/.bashrc
file
If someone could try installing wslu
before setting the variable and see if it still works, I think that could be useful.
@cameron-s-scott @densnow Many thanks both for your detailed answers and investigations! Must have taken quite some time.
I'm starting to think, from your reports, that installing and using WSL is more hassle (and occupies more disk space) than it's worth. The main reason is that allowed -m
requires pytype
, which only works on Unix. However, the JupyterHub installation will be on Unix and will have pytype
and allowed
, so students on Windows users can always use the JupyterHub to check their TMAs. I'll open a new issue for a different kind of installation for Windows.
@mwermelinger,
Sorry I've not been able to respond recently, I've been busy with a personal code project.
You may be interested in creating a docker container for M269. These can run on WSL2 on Windows.
@DanielVernall Thanks, but from the link you give it seems the students would still have to install WSL before installing Docker to then install the M269 image, so I'm not sure what would be the advantage, but I may have got the wrong end of the stick.
@DanielVernall Thanks, but from the link you give it seems the students would still have to install WSL before installing Docker to then install the M269 image, so I'm not sure what would be the advantage, but I may have got the wrong end of the stick.
@mwermelinger yes, it still requires WSL, but I don't think installing WSL is a big problem if you're using docker because all of the required components for the m269 software (python, pytype, etc.) would be bundled in the container image. So there won't be disparate components to install or the possibility of misconfiguration.
The installation for Windows would be:
Thanks for the clarification. I don't think that the problem is with installing the Python environment, because the script does that automatically, it's installing WSL (and hypervisor and wslu...) that is the faff and adding Docker to it doesn't seem to reduce the work.
Closing this as I think it's not justifiable to require WSL just to support allowed -m
. Many thanks everyone for your feedback and time!
The instructions need to be tested and possibly modified for Windows. As I don't have Windows, this requires input from others.
/mnt/c/Users/...
).Many thanks!