Skip to content

Python Set up Guide

Setting Up Python 3.13, Virtual Environments, and Nexus Repository

Section titled โ€œSetting Up Python 3.13, Virtual Environments, and Nexus Repositoryโ€

This guide walks you through setting up Python 3.13, configuring pip, and working with virtual environments. Additionally, it includes steps for integrating with a custom package repository (such as Nexus or PyPI mirrors).


๐Ÿ”น Step 1: Uninstall Existing Python Versions (If Needed)

Section titled โ€œ๐Ÿ”น Step 1: Uninstall Existing Python Versions (If Needed)โ€

If you have older Python versions and want a fresh installation, uninstall them first:

  1. Open Control Panel โ†’ Programs & Features โ†’ Uninstall Python.
  2. Delete leftover Python folders manually:
    Terminal window
    C:\Users\YourUsername\AppData\Local\Programs\Python\
    C:\PythonXX\ # (If installed in Program Files)

  1. Visit the official Python website and download Python 3.13.
  2. Run the installer and select Customize Installation.
  3. Ensure the following options are checked: โœ… pip โœ… Add Python to PATH โœ… Install for all users (recommended)
  4. Click Next and complete the installation.

After installation, open Command Prompt and run:

Terminal window
python --version
pip --version

โœ… Expected Output:

Python 3.13.x
pip 23.x.x from C:\Python313\Lib\site-packages\pip (python 3.13)

๐Ÿ”น Step 3: Configure pip with a Custom Package Repository (Optional)

Section titled โ€œ๐Ÿ”น Step 3: Configure pip with a Custom Package Repository (Optional)โ€

If using a private package repository (e.g., Nexus, Artifactory, or a corporate mirror):

  1. Set the package index URL:
    Terminal window
    pip config set global.index-url https://your-custom-repo-url/
  2. Set trusted hosts:
    Terminal window
    pip config set global.trusted-host your-custom-repo-url
  3. Set global timeout:
    Terminal window
    pip config set global.timeout 60

To verify, try installing a package:

Terminal window
pip install pandas

โœ… The package should download from your configured repository.


A virtual environment allows you to create an isolated Python workspace for your projects.

Navigate to your project directory and run:

Terminal window
python -m venv myenv

โœ… If successful, it will create a folder named myenv.

  • Windows (Command Prompt):
    Terminal window
    myenv\Scripts\activate
  • Windows (PowerShell):
    Terminal window
    myenv\Scripts\Activate.ps1

Your terminal will now show (myenv) at the beginning of the prompt.

Terminal window
pip install requests numpy pandas
Terminal window
pip list

To deactivate the virtual environment:

Terminal window
deactivate

  1. Create a new Python file outside the virtual environment:
    Terminal window
    echo "print('Hello, World!')" > hello.py
  2. Run the script:
    Terminal window
    python hello.py

โœ… Expected Output:

Hello, World!

๐Ÿ”น Step 6: Fixing โ€˜Script Not Found in PATHโ€™ Warnings

Section titled โ€œ๐Ÿ”น Step 6: Fixing โ€˜Script Not Found in PATHโ€™ Warningsโ€

If you see a warning like:

The script f2py.exe and numpy-config.exe are installed in 'C:\Users\YourUsername\AppData\Roaming\Python\Python313\Scripts\'
which is not on PATH. Consider adding this directory to PATH.
  1. Open System Environment Variables (sysdm.cpl โ†’ Advanced โ†’ Environment Variables).
  2. Find Path under System Variables and click Edit.
  3. Click New and add:
    C:\Users\YourUsername\AppData\Roaming\Python\Python313\Scripts\
  4. Click OK, restart your terminal, and retry your commands.

You have now successfully:
โœ” Installed Python 3.13
โœ” Configured pip with a package repository
โœ” Created and activated a virtual environment
โœ” Installed packages and ran a Python script

This setup ensures clean dependency management and avoids system-wide conflicts. Happy coding! ๐ŸŽฏ