I’m currently playing around with Python 3 on Mac OSX. One of the first issues I’ve hit is importing modules. During a Python script the import command is used to call on other modules so that their functionality can be used in the script.

However before Python can import a module, the module must be installed. This installation takes place outside of Python and within the Operating System (OS). I also ran into an issue that MacOSX Terminal did not understand the pip command. I enabled pip/resolved this by firing up a terminal and typing:

sudo python -m ensure pip –default-pip

Then to install modules type:

sudo python3 -m pip install

e.g. to install the “requests” module type:

sudo python3 -m pip install requests

Note: On Mac OSX if you type sudo python instead of sudo python3 then Mac OSX installs the module into Python 2 (which comes with Mac OSX High Sierra).

Welcome to GeekTechStuff

my home away from home and where I will be sharing my adventures in the world of technology and all things geek.

The technology subjects have varied over the years from Python code to handle ciphers and Pig Latin, to IoT sensors in Azure and Python handling Bluetooth, to Ansible and Terraform and material around DevOps.

Let’s connect