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

Script Step to run pip (python 3) #3487

Open
ferPrieto opened this issue May 24, 2022 · 5 comments
Open

Script Step to run pip (python 3) #3487

ferPrieto opened this issue May 24, 2022 · 5 comments

Comments

@ferPrieto
Copy link
Contributor

I've got a workflow where I added a Brew install Step to install Python, which works well.

The next Step that runs after this is a Script Step that I use to run pip (one of the Python tools), in order to install a public plugin.
It contains something like this (I've added a generic name for the plugin, myPlugin):

python3 -m pip --version
python3 -m ensurepip --default-pip 
alias pip='pip3'
pip install myPlugin

The problem is that it always fails saying that it doesn't know what pip is (in the 4th line).
Surprisingly, if I run the workflow with Remote Access and I use the terminal to run the same commands it works. So I'm not sure what the issue is that is causing the pip command not being recognised.

Is this an issue known when it comes to work with Python and the package manager pip?

@matrangam
Copy link

Hey Fernando, have you tried skipping the alias and just calling pip3 directly? I know this is not optimal, but it could help me better understand the problem better if this works.
I should also note that pip3 is already installed on the system.

@ferPrieto
Copy link
Contributor Author

Hey @matrangam I tried that already and didn't work.
When pip3 tries to install any package (using pip3 without the alias), it seems like there's no way to see the latest logs after running that command nor seeing the actual issue.

The next logs are showed after running the script with the alias included:

pip 21.2.4 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Looking in links: /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/tmp1imahec8
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/site-packages (57.4.0)
Requirement already satisfied: pip in /usr/local/lib/python3.9/site-packages (21.2.4)
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise949048163/step_src/._script_cont: line 4: pip: command not found

@matrangam
Copy link

ok, that helps a little I think.
Is it possible for you to share the step repo with me so I can dig into this a little more?

@ferPrieto
Copy link
Contributor Author

ferPrieto commented May 25, 2022

I don't have the Step built yet. I was still playing around with the commands I will use in the Step.
As I mentioned at the beginning of this thread, I've been using these two Steps: Brew install Step & Script Step as a Phase 0 of the project.

@lpusok
Copy link
Contributor

lpusok commented Jun 3, 2022

Hello @ferPrieto,
python3 is also preinstalled, so you should not need to install it. I tried out the xcode-13.4 Stack and could install a pip package:

+ pip3 install celluloid
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Collecting celluloid
  Downloading celluloid-0.2.0-py3-none-any.whl (5.4 kB)
Collecting matplotlib
  Downloading matplotlib-3.5.2-cp39-cp39-macosx_10_9_x86_64.whl (7.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.3/7.3 MB 22.8 MB/s eta 0:00:00
Collecting packaging>=20.0
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.8/40.8 KB 4.5 MB/s eta 0:00:00
Collecting fonttools>=4.22.0
  Downloading fonttools-4.33.3-py3-none-any.whl (930 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 930.9/930.9 KB 36.1 MB/s eta 0:00:00
Collecting pillow>=6.2.0
  Downloading Pillow-9.1.1-cp39-cp39-macosx_10_10_x86_64.whl (3.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 41.9 MB/s eta 0:00:00
Collecting pyparsing>=2.2.1
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 KB 10.3 MB/s eta 0:00:00
Collecting numpy>=1.17
  Downloading numpy-1.22.4-cp39-cp39-macosx_10_15_x86_64.whl (17.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.7/17.7 MB 35.4 MB/s eta 0:00:00
Collecting python-dateutil>=2.7
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 19.6 MB/s eta 0:00:00
Collecting cycler>=0.10
  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.4.2-cp39-cp39-macosx_10_9_x86_64.whl (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.3/65.3 KB 5.9 MB/s eta 0:00:00
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib->celluloid) (1.16.0)
Installing collected packages: python-dateutil, pyparsing, pillow, numpy, kiwisolver, fonttools, cycler, packaging, matplotlib, celluloid
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Successfully installed celluloid-0.2.0 cycler-0.11.0 fonttools-4.33.3 kiwisolver-1.4.2 matplotlib-3.5.2 numpy-1.22.4 packaging-21.3 pillow-9.1.1 pyparsing-3.0.9 python-dateutil-2.8.2
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/opt/python@3.9/bin/python3.9 -m pip install --upgrade pip' command.

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

No branches or pull requests

3 participants