mirror of
https://github.com/NetherlandsForensicInstitute/hansken-python-workshop.git
synced 2026-02-14 13:39:50 +00:00
ce0eb15fb13634f159e1b74926e5f4f12b8424d2
Run examples with Visual Studio Code
Install Code and Python
- Install Visual Studio Code: https://code.visualstudio.com/download
- Install latest Python: https://www.python.org/downloads/
Run script
-
Open folder containing scripts
-
Confirm that you trust the author so the scripts can be run
-
Install Python extension if Code asks
-
Create virtual environment (Ctrl+Shift+P Python: Create Environment)
-
Open terminal to install dependencies (Ctrl+Shift+P Terminal: Create New Terminal)
- Windows: if an error regarding about Execution Policies occurs, change default terminal to Command Prompt instead of PowerShell: File -> Preferences -> Settings -> Features -> Terminal -> Integrated -> Default Profile: Windows -> Select
Command Prompt - In terminal:
pip install -r requirements-{operating_system}.txt - Windows + Python 3.11: If
wordcloudcannot be installed, try installing wheel from here https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud (pip install wordcloud-1.8.1-cp311-cp311-win_amd64.whl) - Linux/MacOS - ignore pywin32 dependency - remove from requirements.txt
- Windows: if an error regarding about Execution Policies occurs, change default terminal to Command Prompt instead of PowerShell: File -> Preferences -> Settings -> Features -> Terminal -> Integrated -> Default Profile: Windows -> Select
-
Replace
hansken_hostvariable with the ip of your host -
Verify if the scripts contain
Run Celloptions -> Download ipykernel package if prompted -
Select default Python installation to use as kernel
-
Linux: If
<ipython-input-3-2c12d96ddab5>:7: UserWarning: Matplotlib is currently using agg;, which is a non-GUI backend, so cannot show the figure.this error pops up:- update imports to explicitly use a gui backend for matplotlib:
matplotlib.use('tkAgg') - install tkinter
pip install tkinter
- update imports to explicitly use a gui backend for matplotlib:
Description
Languages
Python
100%