{
    "url": "https://delaparra-services.nl/manuals/python-installeren",
    "locale": "en",
    "title": "Installing Python · DeLaParra Services",
    "description": "Installing Python 3 on Windows and Linux, creating a virtual environment and installing packages such as NumPy.",
    "alternates": {
        "en": "https://delaparra-services.nl/manuals/python-installeren",
        "nl": "https://delaparra-services.nl/nl/handleidingen/python-installeren"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/manuals/python-installeren.csv",
        "md": "https://delaparra-services.nl/manuals/python-installeren.md",
        "json": "https://delaparra-services.nl/manuals/python-installeren.json",
        "zip": "https://delaparra-services.nl/manuals/python-installeren.zip",
        "pdf": "https://delaparra-services.nl/manuals/python-installeren.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/manuals/python-installeren.csv",
            "encodingFormat": "text/csv",
            "name": "python-installeren.csv"
        },
        {
            "url": "https://delaparra-services.nl/manuals/python-installeren.json",
            "encodingFormat": "application/json",
            "name": "python-installeren.json"
        },
        {
            "url": "https://delaparra-services.nl/manuals/python-installeren.md",
            "encodingFormat": "text/markdown",
            "name": "python-installeren.md"
        },
        {
            "url": "https://delaparra-services.nl/manuals/python-installeren.pdf",
            "encodingFormat": "application/pdf",
            "name": "python-installeren.pdf"
        },
        {
            "url": "https://delaparra-services.nl/manuals/python-installeren.zip",
            "encodingFormat": "application/zip",
            "name": "python-installeren.zip"
        }
    ],
    "markdown": "Installing Python 3 on Windows and Linux, creating a virtual environment and installing packages such as NumPy.\n\n## INSTALLATION | Installing Python.\n\nPython is a programming language for scripting, data and automation. Your AI assistant often uses it for small utilities. Always install a Python 3 version.\n\n### 01 / Windows\n\n01. Go to python.org/downloads and download the latest version for Windows.\n02. Open the installation file.\n03. Tick the box at the bottom labelled **Add python.exe to PATH**. This is important.\n04. Click on **Install Now**.\n05. Reopen PowerShell and check:\n\n```\npython --version\n```\n\nCan you see a version number starting with 3? If so, Python is installed. Does the Microsoft Store open instead? If so, the PATH option wasn’t ticked. Reinstall and make sure to tick it this time.\n\n### 02 / Linux\n\nPython is already installed on most versions of Linux. Check:\n\n```\npython3 --version\n```\n\nAre you missing it, or are you missing pip and venv? Choose the command for your version of Linux.\n\n**Ubuntu / Debian / Linux Mint**\n```\nsudo apt update\nsudo apt install python3 python3-pip python3-venv\n```\n\n**Fedora**\n```\nsudo dnf install python3 python3-pip\n```\n\n**Arch Linux**\n```\nsudo pacman -S python python-pip\n```\n\nOn Linux, you type `python3`, whereas Windows uses `python`.\n\n## PER PROJECT | A virtual environment.\n\nA virtual environment (venv) is a separate folder containing the Python packages for a single project. This ensures that projects do not interfere with one another.\n\n### 03 / Create an environment\n\nOpen the terminal in your project folder:\n\n**Windows**\n```\npython -m venv .venv\n```\n\n**Linux**\n```\npython3 -m venv .venv\n```\n\n### 04 / Turn on the environment\n\n**Windows**\n```\n.venv\\Scripts\\Activate.ps1\n```\n\n**Linux**\n```\nsource .venv/bin/activate\n```\n\nYou should now see (.venv) before the line. Are you getting a message about scripts on Windows? See the manual ‘The Terminal and PowerShell’, section 11.\n\n### 05 / Turn off the surroundings\n\n```\ndeactivate\n```\n\n## PACKAGES | Installing additional features.\n\nYou use pip to install packages: ready-to-use code written by others. NumPy (data processing) and Matplotlib (graphs) are the most commonly searched for.\n\n### 06 / Installing a package\n\nFirst, start the environment, then run the following:\n\n```\npip install numpy matplotlib\n```\n\n### 07 / Identifying which packages you use\n\n```\npip freeze > requirements.txt\n```\n\nAdd this file to Git. You can then install everything in one go on another computer:\n\n```\npip install -r requirements.txt\n```\n\n### 08 / Running a script\n\n```\npython mijn_script.py\n```\n\nOn Linux: `python3 mijn_script.py` if the environment is not set up.\n\n## WORKING WITH AI | Ask your assistant.\n\n### 09 / A task for your AI assistant\n\n\"Check that Python 3 is installed, create a virtual environment for this project and install the packages listed in requirements.txt. Ask for permission before installing anything.\"\n\n**Good to know**\nNever commit the `.venv` directory to Git. Add `.venv/` to the `.gitignore` file. Do not install packages using `sudo pip`.\n\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "TechArticle",
                "@id": "https://delaparra-services.nl/manuals/python-installeren#article",
                "url": "https://delaparra-services.nl/manuals/python-installeren",
                "headline": "Installing Python",
                "description": "Installing Python 3 on Windows and Linux, creating a virtual environment and installing packages such as NumPy.",
                "inLanguage": "en",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/manuals/python-installeren#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/manuals/python-installeren#dataset",
                "name": "Installing Python",
                "description": "Installing Python 3 on Windows and Linux, creating a virtual environment and installing packages such as NumPy.",
                "url": "https://delaparra-services.nl/manuals/python-installeren",
                "identifier": "https://delaparra-services.nl/manuals/python-installeren#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/manuals/python-installeren#article"
                },
                "publisher": {
                    "@type": "Organization",
                    "name": "DeLaParra Services",
                    "url": "https://delaparra-services.nl/"
                },
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/manuals#dataset",
                    "name": "Manuals for working on your own app",
                    "url": "https://delaparra-services.nl/manuals"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "python-installeren.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/manuals/python-installeren.csv",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "python-installeren.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/manuals/python-installeren.json",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "python-installeren.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/manuals/python-installeren.md",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "python-installeren.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/manuals/python-installeren.pdf",
                        "inLanguage": "en"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "python-installeren.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/manuals/python-installeren.zip",
                        "inLanguage": "en"
                    }
                ]
            }
        ]
    }
}