Configuration and Installation Guide: Python and LangPy

This guide details the technical steps to prepare a functional development environment, install the LangPy package, and run scripts with Spanish syntax.

1. Python Interpreter Verification

For proper dependency functioning, Python 3.10 or higher is required.

You must verify the presence of the interpreter on your system through the terminal:

  • Windows: python --version
  • macOS / Linux: python3 --version

If the command is not recognized or the version is lower than 3.10, download the official installer from python.org. On Windows, it is essential to check the "Add Python to PATH" option to allow the system to locate the executable.

2. Virtual Environment Configuration

Using virtual environments is a standard practice that allows isolating a project's libraries, avoiding conflicts with other Python installations.

Environment Creation

Run the following command in your terminal to generate the environment structure:

  • Windows: python -m venv venv
  • macOS / Linux: python3 -m venv venv

Activation

For tools to be installed in the correct location, you must activate the environment:

  • Windows (CMD): venv\Scripts\activate
  • Windows (PowerShell): .\venv\Scripts\Activate.ps1
  • macOS / Linux: source venv/bin/activate

3. LangPy Installation

With the environment active, use the pip package manager to install the library.

pip install langpy

This package allows the interpreter to process programming keywords in Spanish, facilitating logic for Spanish speakers.

4. Script Creation and Execution

LangPy uses a custom file extension (.pyes) to differentiate scripts containing translated syntax.

  1. Open your text editor.
  2. Create a new file and save it as main.pyes.
  3. Insert the following code:
imprimir("Hello from LangPy")

Execution

Unlike standard Python scripts, .pyes files are executed by directly invoking the library command from the terminal:

langpy main.pyes

When executing this command, LangPy performs an internal syntax translation and uses the configured Python interpreter to process the instruction.

Common Problem Solving

In programming environments, it is common to encounter initial configuration errors. Below are the most frequent failures and their technical solutions.

Python is not recognized as an external or internal command

When typing python or pip, the terminal indicates that the command does not exist.

Python was not added to environment variables (PATH) during installation.

Reinstall Python making sure to check the "Add Python to PATH" box or manually add the installation folder path to the system environment variables.

Script execution error (Windows only)

When trying to activate the virtual environment (.\venv\Scripts\Activate.ps1), an error appears about execution policies.

Windows restricts the execution of external scripts in PowerShell.

Run the command: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process

langpy command not found

The command langpy main.pyes returns an unrecognized command error.

The virtual environment is not activated or the pip installation failed.

Verify that the environment is active and reinstall with: python -m pip install --upgrade pip && pip install langpy

Incorrect Python version

LangPy returns unexpected errors when processing the .pyes file.

You are using a Python version lower than 3.10.

Run python --version and update Python from the official site if necessary.