Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 2.49 KB

setup_vs_code.md

File metadata and controls

52 lines (33 loc) · 2.49 KB

Setting up VS Code

We will be using Visual Studio Code (VS Code) as a code editor in the workshop. Please install VS Code before from https://code.visualstudio.com/Download.

You will also need to install Python and the conda package manager. If you have not done so before. please refer to the setup instructions in setup_python_with_anconda.md. Alternatively, you can download and install

  • Python as described here
  • and conda as described here

Finally, in VS code, you also need to install the Python and Jupyter extensions. You can do this by clicking on the "Extensions" icon in the left-hand sidebar, searching for "Python" ("Jupyter") and clicking on the "Install" button.

You shouldn't run into any issues if you have admin rights on your computer. But if you run into difficulties, please check https://code.visualstudio.com/docs/languages/python. If you don't find a solution, you can also email Hauke at [email protected].

Conda environment

Note: You can skip this step if you have already completed steps 3 and 4 in setup_python_with_anconda.md.

To ensure that everyone uses the same python and packages versions, we will create and use a virtual conda environment. For this, you'll need to open

  • the Anaconda Prompt app if you are a Windows user, or
  • the Terminal app if you are a Mac user

In the Anaconda Prompt/Terminal, execute the following lines (by copy-pasting them there and pressing Enter):

conda create -n advanced_text_analysis_gesis -y python=3.11 pip
conda activate advanced_text_analysis_gesis
conda install notebook
pip install -r https://raw.githubusercontent.com/haukelicht/advanced_text_analysis/main/setup/requirements.txt

Selecting the conda environment in VS Code

When running some python script or a cell in a Jupyter notebook in VS Code, you will be prompted to select the python interpreter.

Pop-up in VS Code for selecting a python interpreter

In our case, we will always select the advanced_text_analysis_gesis environment

Alternatives

  • create a native python virtual environment (like this), and/or
  • install the required python packages listed the requirements.txt file manually