ericsysmin's DevOps Blog

How to Install Pyenv on MacOS

Steps to install Pyenv on MacOS

There are a few ways on MacOS to install Python. You can install it via Brew, or by using Pyenv. After needing to switch between different versions of Python often I’ve decided to move to Pyenv. Prior to these steps I removed all versions of Python installed directly with Brew.

1. Update Brew and install prerequisites
We will need to update brew.

In some cases when installing Python >=3.12.1 we will need ncurses. If it’s missing you can install using:

2. Install Pyenv using brew

The recommended way to install pyenv on MacOS is brew.

3. Brew doctor fix

If you want to avoid brew doctor warning about “config” scripts existing outside the system or Homebrew directories please include the following in your shell.

4. Configure your Zsh profile.

If you wish to use Pyenv in non-interactive shells, add the following:

5. Restart shell

6. Install python 3.12

I am going to show how to install python 3.12 but you can select any version of your choice.

7. Switch between your python versions

pyenv shell <version> – modifies python for the current shell session

pyenv local <version> – modifies the python used in the current directory (or subdirectories)

pyenv global <version> – modifies the python used for your user account

 

Continue reading...
Import Self-Signed Cert for Chrome/Edge/Chromium on Mac

Import Self-Signed Cert for Chrome/Edge/Chromium on Mac

With the latest versions of Chrome, Edge, or Chromium, it’s no longer possible to load pages with self-signed certs and they provide a NET::ERR_CERT_INVALID error.

ERR_CERT_INVALID

When you go to the “Advanced” button it does not allow you to ignore and proceed.

To work around this you can download the certificate. Then import it into the trusted certificate store.

I used OpenSSL to download the certificate, but there are other options. Here are the commands I used.

This will add your certificate to the System Keychain and trust it as an SSL certificate.

If you get an the error:

try replacing

to

Continue reading...
Installing Wget via Xcode on Mac OSX

Installing Wget via Xcode on Mac OSX

Install Xcode

First, you will need to ensure that Xcode is installed, and you can install it via the App Store here https://apps.apple.com/au/app/xcode/id497799835?mt=12

Installing Wget

Next, we need to get the latest copy of Wget. We will use curl for this command.

We will extract the tar.gz

Change your directory to the wget folder that was extracted. Then configure it.

Now we need to make wget, and then install it.

Let’s test it to make sure it works

 

Continue reading...