title |
---|
Setup |
This is a comprehensive list of what you are going to need throughout these lessons. To participate in the MicroData workflow, you will need access to the software described below. In addition, you will need an up-to-date web browser. The Carpemtries maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.We will go into details after a quick overview:
- Python 3 installation with pip3 and virtualenv
- BEAD executable
- Git installation, Git Bash on Windows
A useful script to install required programs on Linux can be found here: https://github.com/ceumicrodata/handbook/blob/master/post_install.sh. Let's go through them one by one.
Bash is a commonly-used shell that gives you the power to do simple tasks more quickly.
{% tabs %} {% tab title="Windows" %} Video Tutorial
-
Download the Git for Windows installer.
-
Run the installer and follow the steps below:
- Click on "Next" four times (two times if you've previously installed Git). You don't need to change anything in the Information, location, components, and start menu screens.
- Select "Use the nano editor by default" and click on "Next".
- Keep "Git from the command line and also from 3rd-party software" selected and click on "Next". If you forgot to do this programs that you need for the workshop will not work properly. If this happens rerun the installer and select the appropriate option.
- Click on "Next".
- Select "Use the native Windows Secure Channel library", and click "Next".
- Keep "Checkout Windows-style, commit Unix-style line endings" selected and click on "Next".
- Select "Use Windows' default console window" and click on "Next".
- Leave all three items selected, and click on "Next".
- Do not select the experimental option. Click "Install".
- Click on "Finish".
-
If your "HOME" environment variable is not set (or you don't know what this is): 1. Open command prompt (Open Start Menu then type
cmd
and press [Enter]) 2. Type the following line into the command prompt window exactly as shown:setx HOME "%USERPROFILE%"
- Press [Enter], you should see
SUCCESS: Specified value was saved.
- Quit command prompt by typing
exit
then pressing [Enter]
- Press [Enter], you should see
This will provide you with both Git and Bash in the Git Bash program. {% endtab %}
{% tab title="MacOS" %}
The default shell in all versions of macOS is Bash, so no need to install anything. You access Bash from the Terminal (found in /Applications/Utilities
). See the Git installation video tutorial for an example on how to open the Terminal. You may want to keep Terminal in your dock.
{% endtab %}
{% tab title="Linux" %}
The default shell is usually Bash, but if your machine is set up differently you can run it by opening a terminal and typing bash
. There is no need to install anything.
{% endtab %}
{% endtabs %}
Git is a version control system that lets you track who made changes to what when and has options for easily updating a shared or public version of your code on github.com. You will need a supported web browser.
You will need an account at github.com for parts of the Git lesson. Basic GitHub accounts are free. We encourage you to create a GitHub account if you don't have one already. Please consider what personal information you'd like to reveal. For example, you may want to review these instructions for keeping your email address private provided at GitHub.
{% tabs %} {% tab title="Windows" %} Git should be installed on your computer as part of your Bash install (described above). {% endtab %}
{% tab title="MacOS" %} Video Tutorial
For OS X 10.9 and higher, install Git for Mac by downloading and running the most recent "mavericks" installer from this list. Because this installer is not signed by the developer, you may have to right click (control click) on the .pkg file, click Open, and click Open on the pop up window. After installing Git, there will not be anything in your /Applications
folder, as Git is a command line program. For older versions of OS X (10.5-10.8) use the most recent available installer labelled "snow-leopard" available here.
{% endtab %}
{% tab title="Linux" %}
If Git is not already available on your machine you can try to install it via your distro's package manager. For Debian/Ubuntu run sudo apt-get install git
and for Fedora run sudo dnf install git
.
{% endtab %}
{% endtabs %}
After installation, the further steps are recommended:
- Configure installation
git config --global user.name "your-full-name"
git config --global user.email "your-email-address"
- SSH key: for faster usage (no password will be needed afterwards)
- Check if you already have: Is it anything in .ssh?
ls .ssh
- if no, create a new one and add to ssh agent
- if yes, go to next step
- Add new SSH key to your github account
- Check if you already have: Is it anything in .ssh?
- Download Sublime Merge (recommended git client)
When you're writing code, it's nice to have a text editor that is optimized for writing code, with features like automatic color-coding of key words. The default text editor on macOS and Linux is usually set to Vim, which is not famous for being intuitive. If you accidentally find yourself stuck in it, hit the Esc
key, followed by :
+Q
+!
(colon, lower-case 'q', exclamation mark), then hitting Return
to return to the shell.
{% tabs %} {% tab title="Windows" %} nano is a basic editor and the default that we use, it is installed along with Git.
Other editors that you can use are Notepad++ or Sublime Text. Be aware that you must add its installation directory to your system path. Please ask your instructor to help you do this. {% endtab %}
{% tab title="MacOS" %} nano is a basic editor and the default that we use. See the Git installation video tutorial for an example on how to open nano. It should be pre-installed.
Other editors that you can use are BBEdit or Sublime Text. {% endtab %}
{% tab title="Linux" %} nano is a basic editor and the default that instructors use in the workshop. It should be pre-installed.
Other editors that you can use are Gedit, Kate or Sublime Text. {% endtab %} {% endtabs %}
In MicroData we use the statistical package Stata™, version Stata 17 MP. If you do not have a single user Stata license, please let your instructor know so that they can request one for you. We prefer to use the server version of the Stata. You can start Stata from VNC bash command line by the help of xstata-mp
command.
If you are newly installing single user Stata on your computer, follow these instructions.
{% tabs %} {% tab title="Windows" %}
- Go to https://download.stata.com/download/
- Log in using your username and password.
- Download and launch the installer: SetupStata17.exe version 64.bit.
- Once the installation is done, start Stata from the Start Menu. The first time you do this, you will have to activate your licence.
- Choose version StataMP.
- Enter the serial number provided and press enter.
- Enter the code and press enter.
- Enter the authorization and press enter.
- It should return “Good. The serial number, code, and authorization make sense. Shall we continue?” Type Y and press enter.
- When it asks for the first line, it should say “CEU”.
- When it asks for the second line, it should say “CEU”.
- It will ask for confirmation. Type “Y” and press enter. {% endtab %}
{% tab title="MacOS" %}
- Go to https://download.stata.com/download/
- Download and launch the installer: Stata17.dmg
- Once the installation is done, start Stata from the Start Menu. The first time you do this, you will have to activate your licence.
- Choose version StataMP.
- Enter the serial number provided and press enter.
- Enter the code and press enter.
- Enter the authorization and press enter.
- It should return “Good. The serial number, code, and authorization make sense. Shall we continue?” Type Y and press enter.
- When it asks for the first line, it should say “CEU”.
- When it asks for the second line, it should say “CEU”.
- It will ask for confirmation. Type “Y” and press enter. {% endtab %}
{% tab title="Linux" %}
- Go to https://download.stata.com/download/
- Download Stata17Linux64.tar.gz.
- Open a terminal and navigate to the directory where your downloaded file is located (e.g. cd ~/Downloads/)
- Get superuser rights (sudo su)
- Create a new directory (e.g. mkdir stata_install)
- Move the downloaded file to this new directory (mv Stata17Linux64.tar.gz. stata_install/)
- Enter the directory (cd stata_install)
- Extract the installation files using tar xzf Stata17Linux64.tar.gz
- Create a directory for your stata installation (mkdir /usr/local/stata17)
- Navigate to the stata directory (cd /usr/local/stata17)
- Start the installation by executing the extracted install file (e.g. /home/username/Downloads/stata_install/install)
- Choose version StataMP.
- Whenever the installer asks if you want to proceed type “y” and press enter
- Once the installation is done, type ./stinit to activate your licence
- Whenever it asks you if you want to continue, type “Y” and press enter
- Enter the serial number provided and press enter
- Enter the code and press enter
- Enter the authorization and press enter
- It should return “Good. The serial number, code, and authorization make sense. Shall we continue?” Type Y and press enter.
- When it asks for the first line, it should say “CEU”
- When it asks for the second line, it should say “CEU”
- It will ask for confirmation. Type “Y” and press enter.
- Try to start stata by ./xstata. If it gives you the following error message (./stata: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory), continue with the steps below:
Issue the following commands one by one in your terminal window: apt-get install zlib1g-dev wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb
{% endtab %}
{% endtabs %}
If you use Ubuntu 20.04 LTS or newer, you are good to go. Otherwise you should visit Python's official page and download the latest python version for your operating system. Always follow the installation guide on Python's website.
- (windows only:) Install Git Bash
- Install python if not already installed.
Latest release depends on Python 3.8.5., Python 3 only (requires at least 3.7). You can check the version of your Python from the terminal with python -V
.
-
Download latest version from https://github.com/e3krisztian/bead/releases/tag/v0.8.1
you will need only the platform specific binary:
bead
-
Put the downloaded file in a location, that is on the PATH
$HOME/bin
(single-user, laptop, desktop, traditional location)$HOME/.local/bin
(single-user, laptop, desktop, new XDG standard?)/usr/local/bin
(system, servers, multi-user)
-
(linux and mac only): make the file executable
E.g. the following commands would install version v0.8.1 (latest release at the time of writing) on linux and mac:
# ensure user bin directory existst (for user specific scripts)
mkdir -p ~/.local/bin
# download bead
cd ~/.local/bin
curl -sLo bead https://github.com/e3krisztian/bead/releases/download/v0.8.1/bead
# make executable
chmod +x bead
At the end, you can check whether your installation was successful by typing bead version
to the terminal, then it should show v0.8.1.
(source: https://stackoverflow.com/c/ceu-microdata/questions/18)
Linux and Mac users don't have to install it. Windows users should follow the next steps:
-
Install chocolatey
We are going to install make through the package manager chocolatey, therefore first we have to install chocolatey. Follow the instructions on: chocolatey website
- search for powershell in the windows start menu and run it as administrator
- run the command in the field under the second point (install with powershell.exe)
-
Install gnu-make
- type in the powershell
choco install make
.
- type in the powershell