Fix Makefile to use python3 for venv creation and pip installation
- Replaced 'python' with 'python3' for better compatibility on Arch-based systems - Added ensurepip call to guarantee pip availability inside virtual environment - Improved venv creation logic and ensured setuptools/wheel upgrade - Fixed potential 'pip not found' (Error 127) issue during installation https://chatgpt.com/share/68f2a922-63f8-800f-a6d6-18b8d06b7139
This commit is contained in:
12
Makefile
12
Makefile
@@ -1,16 +1,20 @@
|
|||||||
.PHONY: install setup uninstall
|
.PHONY: install setup uninstall
|
||||||
|
|
||||||
setup: install
|
setup: install
|
||||||
@python main.py install
|
@python3 main.py install
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@echo "Making 'main.py' executable..."
|
@echo "Making 'main.py' executable..."
|
||||||
@chmod +x main.py
|
@chmod +x main.py
|
||||||
@echo "Checking if global user virtual environment exists..."
|
@echo "Checking if global user virtual environment exists..."
|
||||||
@mkdir -p ~/.venvs/pkgmgr
|
@mkdir -p ~/.venvs
|
||||||
@test -d ~/.venvs/pkgmgr || (echo "Creating global venv at ~/.venvs/pkgmgr..." && python -m venv ~/.venvs/pkgmgr)
|
@if [ ! -d ~/.venvs/pkgmgr ]; then \
|
||||||
|
echo "Creating global venv at ~/.venvs/pkgmgr..."; \
|
||||||
|
python3 -m venv ~/.venvs/pkgmgr; \
|
||||||
|
fi
|
||||||
@echo "Installing required Python packages into ~/.venvs/pkgmgr..."
|
@echo "Installing required Python packages into ~/.venvs/pkgmgr..."
|
||||||
@~/.venvs/pkgmgr/bin/pip install --upgrade pip
|
@~/.venvs/pkgmgr/bin/python -m ensurepip --upgrade
|
||||||
|
@~/.venvs/pkgmgr/bin/pip install --upgrade pip setuptools wheel
|
||||||
@~/.venvs/pkgmgr/bin/pip install -r requirements.txt
|
@~/.venvs/pkgmgr/bin/pip install -r requirements.txt
|
||||||
@echo "Ensuring ~/.bashrc and ~/.zshrc exist..."
|
@echo "Ensuring ~/.bashrc and ~/.zshrc exist..."
|
||||||
@touch ~/.bashrc ~/.zshrc
|
@touch ~/.bashrc ~/.zshrc
|
||||||
|
|||||||
Reference in New Issue
Block a user