Python Windows Install & Intellij Set up

🔹 Step 1: Install Python on Windows

  1. Download Python

    • Go to the official site: python.org/downloads

    • Download the latest stable version (e.g., Python 3.12.x).

  2. Run Installer

    • During installation, check ✅ “Add Python to PATH” (very important, like adding JAVA_HOME/bin to PATH).

    • Choose “Install Now”.

  3. Verify Installation
    Open Command Prompt and run:

    python --version
    

    or

    py --version
    

    You should see something like:

    Python 3.12.3
    

🔹 Step 2: Install IntelliJ IDEA + Python Plugin (PyCharm inside IntelliJ)

Since you already use IntelliJ for Java, you can avoid installing PyCharm separately. IntelliJ supports Python via a plugin.

  1. Open IntelliJ IDEA

    • Go to File → Settings → Plugins.

    • Search for Python.

    • Install “Python” plugin (by JetBrains).

    • Restart IntelliJ.

    ✅ If you prefer, you can also install PyCharm Community Edition (free) separately, which is a Python-focused IDE. But IntelliJ + plugin works well.


🔹 Step 3: Configure Python SDK in IntelliJ

  1. Create New Project

    • Go to File → New Project.

    • Select Python (left menu).

  2. Set Interpreter (like JDK in Java)

    • In the Python Interpreter section:

      • Click ⚙️ (gear icon).

      • Select Add Interpreter → System Interpreter.

      • Browse to your Python installation (usually C:\Users\<YourName>\AppData\Local\Programs\Python\Python312\python.exe).

    Analogy: This is like pointing IntelliJ to your java.exe inside the JDK folder.

  3. Finish

    • IntelliJ will index Python libraries (like how it indexes Maven/Gradle dependencies).


🔹 Step 4: Run a Simple Python Program

  1. Create a new Python file: Right-click → New → Python File → name it hello.py.

  2. Add code:

    print("Hello, Python from IntelliJ!")
    
  3. Right-click → Run 'hello'.

You should see output in the IntelliJ Run console:

Hello, Python from IntelliJ!

🔹 Step 5: (Optional) Create a Virtual Environment

Like Java projects use Gradle/Maven dependencies, Python projects often use virtual environments to isolate libraries.

  1. In IntelliJ:

    • File → Settings → Project → Python Interpreter.

    • Choose Add Interpreter → Virtualenv Environment.

    • IntelliJ will create a local isolated environment for dependencies.

  2. Install dependencies using IntelliJ’s package tool or terminal:

    pip install flask
    

    (Like mvn install or gradle build in Java.)


✅ Now you have Python installed, IntelliJ configured, and you can run + manage Python projects just like Java.


Do you want me to also show you how to set up Flask in IntelliJ (so you can run the CRUD project we built directly inside IntelliJ with a Run/Debug configuration), similar to how you run Spring Boot apps?

Comments

Popular posts from this blog

Python Script to Keep Windows Alive