CoreyMS

Development, Design, DIY, and more

  • Contact
  • Portfolio
  • Development
    • Python
    • Git
    • Terminal
    • JavaScript
    • WordPress
  • Design
    • CSS
  • DIY
    • Woodworking
    • Home Improvement
  • Contributors
  • Support
  • Giveaway

An in-depth look at Python’s package management system, pip

April 16, 2015 by Corey Schafer Leave a Comment

In this video, we will take an in-depth look at Python’s package management system, pip. We’ll walk through how to install, uninstall, list, and upgrade packages. We will also dive into how we can output our dependencies and install a list of dependencies.

An in-depth knowledge of pip can be a great addition to your Python tool-belt.

Here is a look at some of the code used in this tutorial:

Install a package

pip install <package_name>

Uninstall a package

pip uninstall <package_name>

Output installed packages to a requirements file.

pip freeze > requirements.txt

Install all packages from a requirements file

pip install -r <name_of_requirements_file>

List installed packages

pip list

List installed packages that need updated

pip list --outdated

Upgrade a package

pip install -U <package_name>

Upgrade all packages (source)

pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U

Filed Under: Development, Python Tagged With: Command Line, Computer Science, pip, Programming, Terminal, Video

Python: virtualenv and why you should use virtual environments

April 14, 2015 by Corey Schafer Leave a Comment

In this video, we will be looking at virtualenv and why you should be using virtual environments in Python. Virtual Environments in Python allow us to keep project-specific dependencies in a separate place than our global site-packages. This is extremely useful when you have different versions of packages for different projects.

Here’s a brief walkthrough of some of the code from the video:

Install virtualenv

pip install virtualenv

Create a location for your environments (Optional)

mkdir ~/Environments
cd ~/Environments

Create a new virtual environment (called venv for this example)

virtualenv venv

Activate your new virtual environment

source venv/bin/activate

At this point you can work from inside of your new virtual environment and know that you are keeping your project-specific packages and dependencies separate.

When you are finished, you can deactivate your virtual environment

deactivate

If you no longer need your environment and would like to delete it, you can just remove the directory

rm -rf venv

Filed Under: Development, Python Tagged With: Command Line, Computer Science, Development Environment, Mac, Programming, Terminal, virtualenv

Resize Multiple Images Using the Mac Terminal

April 5, 2015 by Corey Schafer Leave a Comment

One problem I run into frequently is needing to resize multiple images at once. To do this manually would take way too much time, especially if you have a lot of images.

Luckily, there are several good tools out the to automate this process for us. In this video we will be resizing multiple images using the Mac Terminal and the built-in “sips” command.

If you are someone who is more comfortable using an application rather than the terminal, I also have a video on resizing multiple images using Google’s Picasa. You can find that video here. With that said, in this video we will be focusing on the Mac Terminal. Let’s get started:

Filed Under: Design, Terminal Tagged With: Command Line, Computer Science, Images, Mac, Mac Tip, OS X, Terminal, Video

Terminal 101: Creating Aliases

August 14, 2014 by Corey Schafer Leave a Comment

In this quick tip, we’re going to look at how to create aliases for common terminal commands. If you find yourself typing in the same commands over and over, then it is a good indication that you should write an alias for that. For example, I used to frequently switch to my website’s local theme directory using the command:

cd ~/vagrant-local/www/CoreyMS/htdocs/wp-content/themes/simone-coreyms

That’s a pain to type time and time again! In this video, I’ll show you how you can set up your terminal so that you can create shortcuts for these frequent commands. Then you can create aliases that are unique to you and your workflow. Let’s get started:

Filed Under: Development, Terminal Tagged With: Command Line, Linux, Mac, OS X, Terminal, Video

  • « Previous Page
  • 1
  • 2
  • 3

Main Contributor

  • Andre Nevares

Top Contributors (17)

  • Andre Nevares
  • Cyril Hediger
  • Abhilash Rajan
  • Hien Nguyen
  • Alan Hawse – iotexpert.com
  • Just a Guy
  • Alex Canady
  • Sergey Trubin
  • Justin Presley
  • Sirake
  • chris
  • Jerome Massey
  • Robert Butler
  • Jonathan Llovet
  • David Myers
  • Karthik
  • Michael Zoitas

Thank You! If you would like to have your name listed as a contributor and support the website, you can do so through my Patreon Page. I am extremely grateful for any support.

Search CoreyMS.com

Subscribe to Future Posts

Recommended Books

Podcasts I Listen To

Tech Related:
Talk Python To Me
Shoptalk Show
Software Engineering Radio
HanselMinutes
CodePen Radio

Non-Tech Related:
Dan Carlin's Hardcore History
Bill Burr's Monday Morning Podcast
Waking Up with Sam Harris
StarTalk Radio
Talk Nerdy with Cara Santa Maria

© 2023 · CoreyMS · Corey Schafer