pipx install

jr·2021년 4월 23일

The story goes...

I needed cross-account access from one AWS account to another, and that meant having to set up AWSume.

While I have been using AWSume for some time, I have never set it up on my own. I could sense that it was going to be a challenge. As expected, there was lot of google searching, much frustration, and many chocolate bars (frustration serves as a great excuse to consume chocolate) involved throughout the process. I'm hoping this documentation will help me cut all that down the next time I have to install AWSume or any other packages using pipx.

So what do I do?

  1. Check if python3 is installed. If it is installed, it'll return a version number. If not, download from this page.
    python3 --version
  2. Check if pip3 is installed. If it is, it'll return a version number. If not, well...it should be, according to this Stack Overflow discussion.
    pip3 --version
  3. Create a virtual environment(venv). Let's call it "myEnv":
    python3 -m venv /path/to/myEnv
  4. Activate the venv.
    source myEnv/bin/activate
  5. Download pipx.
    brew install pipx
    pipx ensurepath

Now this is already more wordy than I had imagined and we've just completed getting the tools and venv ready. Next comes the fun part of configuring pipx.

By default, pipx installs packages in ~/.local/bin and creates virtual environments in ~/.local/pipx. To install AWSume in the created venv, these settings have to be changed. Luckily, they can be overriden with environment variables, PIPX_BIN_DIR and PIPX_HOME, respectively (see pipx documentation).

  1. Check all environment varialables. The command returns all environment variables and their values.
    printev
  2. Set the values for the two environment variables.
    export PIPX_BIN_DIR=~/myEnv/bin
    export PIPX_HOME=~/myEnv
  3. For the sake of double checking, return all environment variable values.
    printenv

Finally - the long-awaited ultimate goal of this whole process - install AWSume.

  1. Install AWSume.
    pipx install awsume

Ta-da! If the installation was successful, it'll return a message ending with:

done! ✨ 🌟 ✨

Yielding to the masters

At this point, I will put down my pen. The remaining part of my story involves completing the rest of the AWSume setup and installing AWSume plugins. But I think it'd be best to point to the official documentation for the most accurate and up-to-date information.

profile
My journey starts from Googling "What is a computer language?"

0개의 댓글