Installing via Anaconda - 2022 M&M Short Course X-16 (2024)

Toggle table of contents sidebar

Installing HyperSpy with Anaconda is slightly more involved, but provides moreflexibility if you plan to do more development with Python, or need to run manydifferent Python programs on your machine alongside each other.

While it is mostly unattended, the download and installation of Anaconda cantake a fair amount of time (approximately 10 to 15 minutes, depending on thespeed of your system), so it is highly recommended to do this before youarrive at the tutorial session (and when you have access to a decent internetconnection).

Download#

The installation process for Anaconda varies a bit depending on your operatingsystem. Instructions for Windows are detailed here. MacOS will be somewhat similar,while if you run Linux, you will need to use the command line installer (anexercise left to the reader). From the Anaconda Python link, click theright download for your operating system:

Installing via Anaconda - 2022 M&M Short Course X-16 (1)

Installing Anaconda#

Detailed instructions forWindows,macOS, andLinux are available onthe Anaconda website. Specific instructions for Windows are reproduced below.

Run the downloaded file to proceed with the installation. This process is fairlystraightforward. For the installation location, we highly recommend an easilyaccessed path that does not require administrative rights, such as the folderanaconda3 within your user directory:

The next screen will present you with options about adding Anaconda to thesystem PATH variable, and whether or not you want this installation tobe registered as the “default” Python installation on your system (via akey saved to the registry on Windows). We recommend the default options (asshown below), but if you have other Python installations on your system, you maywant to uncheck the “Register as default” option:

Click the “Install” button at this point, and go to get a coffee or tea (or gofor a walk), as the installation process takes some time depending on your diskspeed.

Once the installation completes, click the “Next” button to continue and then“Finish” to exit the installer.

Usage#

After Anaconda is installed, we suggest taking a look at the“Getting Started” guide from its documentation to familiarize yourself withhow Anaconda is used. There are a few ways to interact with Anaconda, primarilythrough either the “navigator” application, or on the command line. One of themost powerful features of Anaconda is the conda environment and packagemanager, which allows you to create multiple different “installations” (known asenvironments) of Python, enabling you to select which version of Python isused for each environment and what packages are installed inside thatenvironment. A common setup is to have one environment for each project orapplication you are working with. For this tutorial however, we will installHyperSpy into the base (the default) environment (for ease of use) usingthe command line.

Installing HyperSpy with Anaconda#

Like for Anaconda, detailed installation instructions for HyperSpy areavailable directly from its documentation.The process will also be summarized here with a bit more instruction.

Info about code blocks

In the following section, lines in code blocks will be prefaced with $or >>>. $ is used to indicate regular terminal input, while >>>represents inputs to the Python interpreter (accessed by running pythonfrom the regular command line. Any lines without these symbolsindicate the expected output of the given command. To run thecommands provided, copy everything after the $ or >>> character intoyour terminal. Where necessary, commands will be given for both the WindowsAnaconda prompt and the macOS/Linux terminal, so only use the commandsspecific to your operating system.

From the Start Menu (on Windows), open the Anaconda Prompt:

On Mac or Linux, open a terminal as normal. If during installation you toldthe installer to “initialize” Anaconda3, all the conda commands shouldbe immediately available. If not, you will have to run the following, replacingthe bracketed term with the actual path in which you installed Anaconda:

$ source <ANACONDA_INSTALL_PATH>/bin/activate

before any of the conda commands will work. Again, this is only forMac/Linux, the commands should be available with no problem on Windows whenyou launch the Anaconda Prompt.

From the prompt, run the following to install HyperSpy, its UI package, and itsdependencies:

$ conda install -c conda-forge hyperspy hyperspyui kikuchipy atomap pyxem

After Anaconda calculates the dependencies (this may take quite a while,please be patient) it will need to install, it will ask for confirmation to continue.Press Enter to accept the changes, and wait for the requested libraries to beinstalled.

Extension packages

The “extension” libraries kikuchipy, pyxem, and atomap will beinstalled using the command above. These are not absolutely necessary to installif you wish to just use HyperSpy on its own, but since these libraries willbe covered in the short course, you will need to have them installed if youwish to follow along interactively.

Testing the installation#

Once the install is completed, if you would like to test that your installationis working properly, you can run a small test example by opening the“Qt Console”. From within the Anaconda Prompt, enter the following commandand then press Enter:

$ jupyter qtconsole

The Qt Console is an interactive Python interpreter that allows you to enterPython statements directly and immediately see their output. Once the consolehas opened and you see a prompt that says In [1]:, copy the following codesnippet at the location of the blinking cursor:

%matplotlib qtimport hyperspy.api as hss = hs.datasets.artificial_data.get_core_loss_eels_signal(add_powerlaw=True)s.remove_background()

Very briefly, this code is loading the interactive plotting libraries, loadingHyperSpy, creating an example EELS signal from some artificial data, and thentelling the interpreter you want to interactively remove the Power Lawbackground. Press Shift-Enter within the console to run the lines of codeyou pasted in (it may take a few moments to run if this is the first timeyou’ve used HyperSpy on your machine):

Eventually, you should see a spectrum window and a small tool window forremoving the background open (they may be stacked on top of each other;drag them out of the way, if so). If you click and drag on part of the spectrumdisplay, HyperSpy will fit a Power Law to the signal within that region,and also show you a preview of the background-subtracted signal:

Clicking “OK” in the Background removal tool window will perform thebackground subtraction, and replace the window with one showing the resultingsignal:

Assuming all of this worked, congratulations! You have a working HyperSpyinstallation and you have run your first bit of open-source HyperSpy-basedmaterials science data analysis! Click the button below to return to the maintutorial homepage:

Click here to returnto the main page

Installing via Anaconda - 2022 M&M Short Course X-16 (2024)
Top Articles
Technological innovations: How Blockchain is changing business processes across various industries
How to Consolidate Student Loans - Experian
Cappacuolo Pronunciation
Fredatmcd.read.inkling.com
Chambersburg star athlete JJ Kelly makes his college decision, and he’s going DI
Frank Lloyd Wright, born 150 years ago, still fascinates
Dr Doe's Chemistry Quiz Answer Key
Fnv Turbo
Barstool Sports Gif
Cinepacks.store
Cvs Devoted Catalog
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Tight Tiny Teen Scouts 5
Dutchess Cleaners Boardman Ohio
Video shows two planes collide while taxiing at airport | CNN
U Arizona Phonebook
Craigslist Pinellas County Rentals
Walmart Car Department Phone Number
Iu Spring Break 2024
Panolian Batesville Ms Obituaries 2022
Lexus Credit Card Login
Craig Woolard Net Worth
Kohls Lufkin Tx
fft - Fast Fourier transform
Timeline of the September 11 Attacks
Acurafinancialservices Com Home Page
Tim Steele Taylorsville Nc
Myaci Benefits Albertsons
Vlacs Maestro Login
Frequently Asked Questions - Hy-Vee PERKS
Ancestors The Humankind Odyssey Wikia
Emily Katherine Correro
Urban Blight Crossword Clue
Where Can I Cash A Huntington National Bank Check
Bozjan Platinum Coins
Bratislava | Location, Map, History, Culture, & Facts
What Time Does Walmart Auto Center Open
Craigslist Hamilton Al
How Does The Common App Work? A Guide To The Common App
Sas Majors
Seven Rotten Tomatoes
Nail Salon Open On Monday Near Me
Quaally.shop
Go Nutrients Intestinal Edge Reviews
Swsnj Warehousing Inc
Craigslist Anc Ak
Slug Menace Rs3
Cvs Minute Clinic Women's Services
Okta Hendrick Login
Les BABAS EXOTIQUES façon Amaury Guichon
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 6070

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.