C4_W2_Lab_1 - Permission denied - unable to clone repo

Getting this message.

fatal: could not create work tree dir ‘machine-learning-engineering-for-production-public’: Permission denied

Please help

1 Like

From a bash terminal, managed to clone repo it by creating /tmp/new directory and running git clone from there. It was not allowing to clone at the root.

Now into course4/week2-ungraded-labs/C4_W2_Lab_1_FastAPI_Docker/no-batch/ directory with all files in place as per One prediction per request instruction page

Unable to run python codes like import pickle at bash prompt.

How do I get python here? Lab Instruction does not provide that.

1 Like

Hi @bolt99! I’m glad you got the repo cloning working. Did you install conda in your bash? If so, you might need to activate it using something like conda activate base.

However this lab does not require you to run the scripts using Python, instead Docker is used. The lab walks you through the code, explaining what it is doing but it is not meant to be run unless you specifically want to.

1 Like

Thank you for your prompt response.
No, I don’t know how to install conda in my bash. I am new to linux/bash commands/environments.
What should I exactly do at my bash command prompt to install conda? Is it same as installing conda on Linux? Hence do the following command?

bash Anaconda-latest-Linux-x86_64.sh

Please let me know. I am trying to build my first python image using docker by following the tutorial at docker. Don’t need it for this tutorial but will need later.

Regards.

1 Like

Yes! It is exactly the same as installing it on Linux. You can follow the official docs here.

Let me know if you manage to setup your conda environment.

1 Like

Thank you a-zarta.
I have installed anaconda3 at my Linux home directory - /home/user/
But python script like below still does not work from bash prompt

/mnt/c/Users/user/machine-learning-engineering-for-production-public/course4/week2-ungraded-labs/C4_W2_Lab_1_FastAPI_Docker/no-batch$

import numpy.

It seems it is not meant to work from bash prompt anyway. I was trying to build dockerfile and docker image from scratch as shown in lab above. But this is not the way to do it.

I ran the docker image build using Dockerfile provided and everything ran even before installing anaconda for Linux. So I guess line in Dockerfile

FROM frolvlad/alpine-miniconda3:python3.7

provided the necessary environment.

Can I take it that to build Dockerfile and image etc. from scratch I have to use some text editor like vim or nano to create the Dockerfile, main.py files separately first and then place them in the directory structure as needed by Flask and then run as shown in lab?

One question still remains: where does one get the name of the image as mlepc4w2-ugl? Or can I just change it to my choice and rerun it instead of

docker build -t mlepc4w2-ugl:no-batch .
to
docker build -t my-choice:no-batch .

Will it still work if I then do

docker run --rm -p 80:80 my-choice:no-batch
instead of
docker run --rm -p 80:80 mlepc4w2-ugl:no-batch

All these may be too basic, but I am a beginner here.
Thanks for your time

1 Like

Hi @bolt99! Sorry for the late response. So the idea of the lab is that you do not need to create or edit any file, all of the files have already been provided. The snippets such as this


are there only to guide you through what is happening inside the files, you don’t have to run that code by yourself. In fact you can find that exact code in main.py.

About the name of the image, in general you can name them whatever you want and it should run. However some future labs will reuse some of these images so it is better to stick to the naming provided or you might encounter some issues in other labs.

Last thing, I noticed you cloned the repo under /mnt/c/Users/user/ (the windows filesystem). In general it is a good practice to save everything under the WSL2 filesystem when using bash, something like /home/user/repos should be fine. This way all your scripts will run faster.

Let me know if this addresses all your questions and if you got more :slight_smile:

Thank you for your response.
I understand. Getting more familiar with Linux environment. Have started working from Linux file systems. Only thing is I am unable to open html files from Linux. Downloaded and tried getting chrome to open html file. But not worked so far.

What am I missing?
Regards

Maybe you can try installing vscode. By installing it and configuring the code command you can use it to open any file like code some-file.html. It is what I use for work :slight_smile:

Thank you. Used wrong phrase ‘open html file from Linux terminal’. I want to render the html page in a browser and see how it looks. Since /home/user directory is hidden in windows file system, I cannot double-click the file at windows explorer and see it in chrome browser.

Downloaded chrome for Linux file system. But ‘google-chrome some-file.html’ from terminal is not working.

Regards
Sanjoy

I don’t know much about rendering html but there must be a way somehow :thinking: Let me know if you figure it out!

Thank you
Yes there sure is a method. Just not able to search it out. From terminal, want to say something like:

open abc.html

and the page should open at the default browser. Anyone who knows please share