noahgift / Python-MLOps-Cookbook

This is an example of a Containerized Flask Application that can deploy to many target environments including: AWS, GCP and Azure.
Creative Commons Zero v1.0 Universal
395 stars 310 forks source link

make install NOT working on cloud9, no action needed but I do attach my slightly edited and working Makefile #3

Closed botanyhelp closed 3 years ago

botanyhelp commented 3 years ago

I run these three commands in cloud9 and get an error on the make install step:

botanyhelpcli:~/environment $ git clone https://github.com/noahgift/Python-MLOps-Cookbook.git

botanyhelpcli:~/environment $ cd Python-MLOps-Cookbook/

botanyhelpcli:~/environment/Python-MLOps-Cookbook (main) $ make install 

The error talks about python2.7 being deprecated. I have these aliases that come with cloud9:

botanyhelpcli:~/environment/Python-MLOps-Cookbook (main) $ which python
alias python='python3'
        /usr/bin/python3
botanyhelpcli:~/environment/Python-MLOps-Cookbook (main) $ which pip
alias pip='pip3'
        /usr/bin/pip3

..and so I am not sure where python2 is coming in. To fix, I edit the Makefile and run again:

botanyhelpcli:~/environment/Python-MLOps-Cookbook (main) $ vim Makefile 
botanyhelpcli:~/environment/Python-MLOps-Cookbook (main) $ make install 

During the vim editing I replace all 'python' with 'python3' and 'pip' with 'pip3' but that did not work because the package name for pip is still 'pip', not 'pip3', and so I have to leave the package name 'pip' as 'pip'. I would send you a pull request but it could be some kind of cloud9 misconfiguration on my end. I paste my slightly edited Makefile below:

botanyhelpcli:~/environment/Python-MLOps-Cookbook (main) $ cat Makefile 
install:
        pip3 install --upgrade pip &&\
                pip3 install -r requirements.txt

test:
        python3 -m pytest -vv --cov=cli --cov=mlib --cov=utilscli test_mlib.py

format:
        black *.py

lint:
        pylint --disable=R,C,W1203,E1101 mlib cli utilscli
        #lint Dockerfile
        #docker run --rm -i hadolint/hadolint < Dockerfile

all: install lint test
botanyhelp commented 3 years ago

UPDATE: I had to do the same exact thing for the Makefile in fastapi repo.

noahgift commented 3 years ago

I would recommend creating a Python virtual environment and then sourcing that: python3 -m venv ~/.venv && source /.venv/bin/activate

botanyhelp commented 3 years ago

Yes..I have seen in super-excellent videos exactly that advice which I did not do. I did it but now I get disk full error:

ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device: '/home/ec2-user/.venv_Python-MLOps-Cookbook/lib64/python3.7/site-packages/pandas/tests/arrays/categorical/test_missing.py'

But I think I have notes from another super-excellent video on how to change that 10Gig cloud9 disk to a 20Gig disk.
I will work on that now.
I am trying to love cloud9 but its happening slowly. You can close this Issue and know that I appreciate the super-efficient learning you kindly share!