This page describes the steps necessary to setup the Python and Jupyter environment necessary to work with my courses. If you are familiar with Python, the following tl;dr might be enough:
tl;dr: Create a Python3 virtual environment and run
pip install requirements_ofdm.txtfrom the
codesubdirectory, followed by
Here, we use the Anaconda Python Distribution due to its simplicity. However, if you prefer another distribution, the course will still work. But, in this case we assume you will be able to setup your environment on your own.
Please choose your operating system:
Please note: With the recent Python 3.7 for Windows, Jupyter cells cannot be interrupted when running (see here and here). Therefore it is recommended to stick with Python 3.6 for now, see here on how to install an older version of Anaconda that contains Python 3.6 instead of 3.7.
We start by downloading the Anaconda Python Distribution. This course is tested with
Anaconda 5.2containing Python 3.6 64bit. Any 64bit Python above 3.3 will be fine running the course. After the file is downloaded, start the installation:
Answer yes to register Anaconda as the system Python installation:
If the setup asks to install Visual Studio Code, you can safely skip this installation step, as we do not need the VS Code editor.
After Anaconda is installed, we are going to install
gitwhich we need to download the tikzmagic extension. Go to the git homepage and download the installer. Then, start the installation:
In the following screens, you can safely keep the defaults:
After installing git, we can now setup the Python Environment. Open the Windows Start menu and start thp
Anaconda Navigator. In the Navigator click on
Environmentson the left and choose
Createin the bottom:
As the environment name we choose
dspcourseand we click
Createin the dialog:
After the environment is created, we will run a Terminal within the environment:
A windows command line terminal starts, indicating
(dspcourse)at the prompt, which means that we are currently working in the
In the following we assume that the downloaded course files are extracted to the Windows Desktop. So, in the terminal, using the
cdcommand, navigate to the directory where the files are located. Note that the terminal supports Tab completion, i.e. in the below example, I typed
cd De<TAB>to get expanded to
cd Desktopautomagically. Navigate into your course subdirectory. Note that the command
dirlists all the contents in the current directory, so it can help you find your way.
You can now install the required packages for the course. The packages are listed in a
requirements.txtfile which is located in the
codesubdirectory of your downloaded files. Run the
pipprogram (which is part of Python) to read this file and install all dependencies in it:
After the command has finished, all necessary packages are installed:
The final step now is to start the Jupyter Notebook by running the command
The command starts the Jupyter server and opens a browser window showing the contents of the current directory. Navigate around until you find the Welcome-File for your course and open it.
Once you have opened the file, follow the link to the notebook "Setting up the development environment" to check your python installation and get into the actual course contents.
The above instructions made you ready to run the Python code of the course. However, if you want to be able to also regenerate the LaTeX figures, you need to install MikTex, ImageMagick and Ghostscript. Note that these steps are purely optional. If you do not install these packages, you will not be able to redraw the latex figures, but still be able to run all the code.
ask me firstat the option "Install missing packages on-the-fly":
The next step is to install ImageMagick. Download the
dll-Version and run the installer:
Make sure you choose
Install legacy utilities (e.g. convert)in the dialog:
Once ImageMagick is installed, you also need to install GhostScript. Choose the 32bit version, e.g. this link. Run the installer and keep the default options for the installation.
As a final step, you need to make the GhostScript binaries available in your PATH: In the Windows start menu, type
Edit environment variables for your account:
In the dialog, mark the
Pathvariable and choose
Edit. In the field append the value
C:\Program Files (x86)\gs\gs9.25\binto the field. (Make sure that your installation of GhostScript actually resides in this folder, otherwise adapt your variable settings):
You can now try out the Latex Installation and open the "Setting up the development environment" notebook. Execute the last cells and see, if you can generate the picture:
During the run, MiKTeX will ask you if you want to install missing packages, which you need to confirm:
Finally, the installation should be complete and the tikz picture should be successfully generated:
If there are errors, consult the output of the jupyter notebook console or the output with the notebook.
We start by downloading the Anaconda Distribution. This course is tested with
Anaconda 5.3 containing
Python 3.7 64bit. Any 64bit python above 3.3 will be fine running the course.
After the file is downloaded, open a Linux terminal and navigate to your downloaded file:
Then, we need to make the setup file executable by issuing
chmod +x Anaconda3-5.3.0-linux-x86_64.sh .
Then, run the installer
Confirm the installation location or choose another as requested by the setup:
For our purposes we do not need to install Visual Studio Code, which is bundled with Anaconda. So, just answer
no at the prompt.
Great! You have now installed Anaconda. The next step is to create a virtual environment for the course. It is usually recommend to use a virtual environment to not run into packet version clashes. So, we create a virtual environment named
dspcourse by running the command
conda create --name dspcourse:
Now, as you have setup the virtual environment, it's time to move into the source code of the course. Using your terminal, navigate into the directory where you extracted the source code:
It's time to activate the virtual environment. If you want, you can list available environments with
conda info --envs. Activate the environment with
conda activate dspcourse.
We will now install the required python packages. To do this, issue the command
pip install code/requirements_ofdm.txt (or, replacing the name of the requirements file with the file that is provided by your course).
cannot find command: git, you need to install the git version control system. On Ubuntu, you do this via
sudo apt-get install gitand provide your password:
Once git is installed, rerun the command to install the requirements by
pip install code/requirements_ofdm.txt. This time, there should be no errors with the installation:
Finally, you are able to start the Jupyter notebook by
jupyter notebook. A browser will open, showing you a list of files in the current directory.
code/ipynbto find the actual contents of the course.
Congratulations! You have successfully setup your development environment. The next time you want to work with the course, just open a terminal, navigate to the course root directory and run
conda activate dspcourse
In addition to the
tikzmagic extension (which is installed via
pip) you need to have LaTeX installed on your PC to redraw the figures that use
tikz. The according ubuntu packages are
apt-get install texlive-latex-extra texlive-latex-pictures
apt-get install imagemagick ghostscript
/etc/ImageMagick-7/policies.xmland comment out the line
<policy domain="coder" rights="none" pattern="PDF" />if it is present (see here)