Welcome to my journey of continuous discovery. Enjoy your visit.

Ugli Scripting
Ugli Scripting
  • Home
  • Blog
  • .PY
    • Python 2.7 on Windows
    • Python 2.7 on Ubuntu
    • Python 2.7 IDE Set up
    • Run Python Script via CLI
    • Adding Python Packages
    • Basic REST API
  • .PS1
    • Install AD Module Win 10
    • Connecting to MSO and EOP
    • Storing Script Variables
    • Storing Secure Strings
    • Storing User Credentials
    • Basic REST API
  • Sample Integrations
    • Isolate SEP Clients
    • Force Password Change
    • o365 Account Remediation
    • Threat Response Lists
    • Endpoint Scripts
  • SITQ Lab
    • Lab Resources
    • AD Lab Account Imports
    • DLP Sample
  • More
    • Home
    • Blog
    • .PY
      • Python 2.7 on Windows
      • Python 2.7 on Ubuntu
      • Python 2.7 IDE Set up
      • Run Python Script via CLI
      • Adding Python Packages
      • Basic REST API
    • .PS1
      • Install AD Module Win 10
      • Connecting to MSO and EOP
      • Storing Script Variables
      • Storing Secure Strings
      • Storing User Credentials
      • Basic REST API
    • Sample Integrations
      • Isolate SEP Clients
      • Force Password Change
      • o365 Account Remediation
      • Threat Response Lists
      • Endpoint Scripts
    • SITQ Lab
      • Lab Resources
      • AD Lab Account Imports
      • DLP Sample

  • Home
  • Blog
  • .PY
    • Python 2.7 on Windows
    • Python 2.7 on Ubuntu
    • Python 2.7 IDE Set up
    • Run Python Script via CLI
    • Adding Python Packages
    • Basic REST API
  • .PS1
    • Install AD Module Win 10
    • Connecting to MSO and EOP
    • Storing Script Variables
    • Storing Secure Strings
    • Storing User Credentials
    • Basic REST API
  • Sample Integrations
    • Isolate SEP Clients
    • Force Password Change
    • o365 Account Remediation
    • Threat Response Lists
    • Endpoint Scripts
  • SITQ Lab
    • Lab Resources
    • AD Lab Account Imports
    • DLP Sample

Adding Python Packages

Project Packages

Below is a running list of Python packages I have used so far.


pip  -  Python package manager

requests  -  used for Rest API requests

pycrypto  -  used to encrypt and decrypt strings

urllib3  -  error handling of certificates



Python Homepage

Python Homepage

Using PyCharm or other IDE to manage packages

Using PyCharm to install additional packages is quick and easy.  In additional to managing the install, PyCharm also does a good job reporting on dependency errors.  Most times it will automatically add the additional packages or provide easy directions for resolution.


For example, when install the pycrypto package on Windows you will receive an error stating Visual C++ for Python 2.7 is required along with a link to download.



Project Interpreter

Open Settings and go to Project Interpreter. Click the '+' to search for additional packages to install.

Available Packages

Locate the pycrypto package and select 'Install Package'.


Did you get a dependency error? Go ahead and install Visual C++ for Python 2.7 and install pycrypto again.


Repeat the process for any additional Python packages from the Project Packages list.

Using pip to install the modules on Ubuntu

It is important to keep your Python package installations  to same across all platforms to help in testing.  Failing to use a Package that runs on all platforms will lead to frustration later. If a module doesn't work on all your required platform, I recommend you keep searching.


When installing pycrypto on Windows we received an a dependency error.  You quickly want to resolve any future problems, so be sure to test your other system sooner rather than later. 

Windows PowerShell

Open PowerShell and SSH to your Ubuntu host. Run the following command.


$ pip install pycrypto


As you can see, there were no errors.  I'm comfortable moving forward using this package.


Install the remaining packages from the Project Pages list above using pip.

Copyright © 2018 Ugli Scripting - All Rights Reserved.

  • Blog
  • CV

Powered by GoDaddy