Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note pip is required for install + build should note failure if pip is missing #2894

Open
MrCreosote opened this issue Apr 15, 2022 · 4 comments
Labels

Comments

@MrCreosote
Copy link
Member

MrCreosote commented Apr 15, 2022

Not all python installs come with pip, including the deadsnakes ppa.

~$ mkdir nardev
~$ cd nardev
~/nardev$ git clone https://github.com/kbase/narrative.git
~/nardev$ cd narrative
~/nardev/narrative$ conda create -n nardev
~/nardev/narrative$ conda activate nardev
(nardev) ~/nardev/narrative$ ./scripts/install_narrative.sh 
2022-04-14 18:21:17 [install_narrative] Install: complete log in: /home/mrcreosote/nardev/narrative/install.log
2022-04-14 18:21:17 [install_narrative] Installing front end build components with npm
npm WARN deprecated [email protected]: breaks
npm WARN deprecated @stylelint/[email protected]: Use the original unforked package instead: postcss-markdown
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

> [email protected] prepare
> husky install

husky - Git hooks installed

added 1436 packages, and audited 1437 packages in 44s

186 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (3 moderate, 8 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New minor version of npm available! 8.5.0 -> 8.7.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.7.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice 

> [email protected] install-npm
> node scripts/install-npm.js

2022-04-14 18:22:03 [install_narrative] Installing IPython version 7.9.0
./scripts/install_narrative.sh: line 106: pip: command not found
2022-04-14 18:22:03 [install_narrative] Installing Jupyter notebook version 6.0.2
./scripts/install_narrative.sh: line 111: pip: command not found
2022-04-14 18:22:03 [install_narrative] Installing ipywidgets using 
./scripts/install_narrative.sh: line 115: pip: command not found
2022-04-14 18:22:03 [install_narrative] Installing biokbase requirements from src/requirements.txt
./scripts/install_narrative.sh: line 121: pip: command not found
./scripts/install_narrative.sh: line 129: pip: command not found
2022-04-14 18:22:03 [install_narrative] Installing biokbase modules
2022-04-14 18:22:03 [install_narrative] Running local 'setup.py'
./scripts/install_narrative.sh: line 142: python: command not found
2022-04-14 18:22:03 [install_narrative] Done installing biokbase.
2022-04-14 18:22:03 [install_narrative] Installing scripts
dirname: missing operand
Try 'dirname --help' for more information.
dirname: missing operand
Try 'dirname --help' for more information.
2022-04-14 18:22:03 [install_narrative] Putting new kbase-narrative command under 
/bin/mv: cannot move 'kbase-narrative' to '': No such file or directory
2022-04-14 18:22:03 [install_narrative] Done installing scripts
2022-04-14 18:22:03 [install_narrative] Installing nbextensions
Root dir
/home/mrcreosote/nardev/narrative/nbextensions
install.sh: 14: jupyter: not found
install.sh: 15: jupyter: not found
install.sh: 17: jupyter: not found
install.sh: 18: jupyter: not found
install.sh: 20: jupyter: not found
install.sh: 21: jupyter: not found
install.sh: 23: jupyter: not found
install.sh: 24: jupyter: not found
install.sh: 26: jupyter: not found
install.sh: 27: jupyter: not found
install.sh: 29: jupyter: not found
install.sh: 30: jupyter: not found
install.sh: 32: jupyter: not found
install.sh: 33: jupyter: not found
install.sh: 35: jupyter: not found
install.sh: 36: jupyter: not found
install.sh: 38: jupyter: not found
install.sh: 39: jupyter: not found
./scripts/install_narrative.sh: line 172: jupyter: command not found
2022-04-14 18:22:03 [install_narrative] Done installing nbextensions
2022-04-14 18:22:03 [install_narrative] Done. Run the narrative with the command: kbase-narrative
@MrCreosote
Copy link
Member Author

So it's still an issue that you don't always get pip with python, but in my case it seems to be conda idiocy:

(base) ~$ which pip
/home/mrcreosote/miniconda3/bin/pip
(base) ~$ which python
/home/mrcreosote/miniconda3/bin/python
(base) ~$ mkdir nardev
(base) ~$ cd nardev/
(base) ~/nardev$ git clone https://github.com/kbase/narrative.git
(base) ~/nardev$ conda create -n nardev
(base) ~/nardev$ conda activate nardev
(nardev) ~/nardev$ which pip
(nardev) ~/nardev$ which python

@ialarmedalien
Copy link
Collaborator

ialarmedalien commented Apr 15, 2022

can you edit your install script to add these lines at line 103, and then rerun the installer? It should now install and update pip for you. If that fixes your issue, I'll make a PR. ATM these lines are run in the Dockerfile but not in the installer script.

    # Ensure pip is installed and up to date
    # --------------------------------------
    log "Checking for pip and updating if necessary"
    python -m ensurepip --upgrade && python -m pip install --upgrade pip setuptools wheel 2>&1 | tee -a "${logfile}"

...although if you don't have python in your conda environment, this addition isn't going to help much!

@MrCreosote
Copy link
Member Author

I switched to pipenv vs. conda which seems to have worked. The only drawback is that the Pipfile isn't updated

@MrCreosote
Copy link
Member Author

ensurepip

Apparently even this module being present isn't guaranteed. I vaguely remember reading about what amounts to a holy war between distro package maintainers and pipites - the maintainers thought, IIRC, that all SW installs, including for software development, should go through the distro package system, and thus pip, npm, etc. were anathema to them. Hence in some cases the ensurepip module is removed from the python package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants