Netaji Subhas University Students: Setting Up a Reproducible Python Environment for AI Internship Work

Netaji Subhas University Students: Setting Up a Reproducible Python Environment for AI Internship Work

Facebook
Twitter
LinkedIn
WhatsApp
Email

A reproducible Python environment means someone else can install your exact package versions, run your code and get the same numbers you got. You get there with four habits: one virtual environment per project, a pinned requirements file, fixed random seeds, and a short README that records how to run everything. In a 14-day AI internship, setting this up on day one saves hours of debugging later.

Why reproducibility matters in a 14-day AI internship

A short internship leaves no room for “it worked yesterday”. If your model accuracy changes from 81% to 76% between runs and you cannot say why, the reviewer cannot trust either number. Most unexplained changes come from three sources: a library upgraded silently, a random process that was not seeded, or a script that depended on a file only present on your machine.

The free two-week online internship at CareerSwami asks you to submit work that others read, so a clean setup is part of the deliverable, not a bonus. The offer letter and completion certificate are free; the discipline you build is what you carry into your next project.

Day-one setup checklist for a Python AI project

Work through this list in order. Each step takes a few minutes.

  1. Check your Python version. Run python --version (or python3 --version on Linux and macOS). Pick one version, such as 3.10 or 3.11, and write it down. Many AI libraries lag behind the newest Python release, so the very latest version can cause install failures.
  2. Create a project folder. One folder per project, with a short name and no spaces, for example churn-model.
  3. Create a virtual environment inside it. Run python -m venv .venv.
  4. Activate it. On Windows: .venv\Scripts\activate. On Linux or macOS: source .venv/bin/activate. Your prompt should show (.venv).
  5. Upgrade pip inside the environment. Run python -m pip install --upgrade pip.
  6. Install only what you need. For a typical tabular task: pip install numpy pandas scikit-learn matplotlib jupyter.
  7. Freeze versions. Run pip freeze > requirements.txt.
  8. Add a .gitignore. Include .venv/, __pycache__/, and large data files.
  9. Write a README with run steps. Python version, install command, how to run the main script, and expected output.
  10. Test from scratch. Delete .venv, recreate it, run pip install -r requirements.txt, and run your script. If it fails, your setup is not yet reproducible.

Free 2-Week CareerSwami Internship

Online, 14 days, with a free offer letter and a free completion certificate once you finish the work. Check with your college that it fits your requirement before you enrol.

Apply for the free internship

Choosing between venv, conda and a requirements file

Option Best for Watch out for
venv + pip Most internship projects; ships with Python Does not manage the Python version itself
Conda / Miniconda Projects needing non-Python libraries, or several Python versions Mixing conda install and pip install carelessly can create conflicts
requirements.txt Sharing exact package versions Must be regenerated after you add packages
environment.yml Sharing a conda environment Platform-specific builds may not match on another OS

If you have no strong reason for conda, use venv. It is simpler and every reviewer can reproduce it. If you do use conda, pick one tool for installing and stay with it.

Writing a requirements file others can actually install

A frozen file lists every package, including dependencies you never installed directly. That is fine for exact reproduction. For readability, many people keep two files.

  • requirements.txt: the full pinned output of pip freeze, used for exact reproduction.
  • requirements-min.txt (optional): only the packages you chose, with minimum versions, for a human to read.

Illustrative pinned file (version numbers here are examples, not recommendations):

numpy==1.26.4
pandas==2.2.2
scikit-learn==1.4.2
matplotlib==3.8.4
jupyter==1.0.0

Rules to follow:

  • Use == for exact pins in the file you submit.
  • Regenerate the file after every new install.
  • Never copy a requirements file from another project without checking it. It may pull in dozens of packages you do not need.
  • Note GPU libraries separately. A PyTorch or TensorFlow build for a GPU depends on your drivers, so record the exact install command from the library’s official page in your README.

Setting random seeds for repeatable model results

Random seeds fix the starting point of random number generators, so shuffles, train-test splits and weight initialisation repeat. Set them at the top of your script and keep the value in one place.

import os, random
import numpy as np

SEED = 42
os.environ["PYTHONHASHSEED"] = str(SEED)
random.seed(SEED)
np.random.seed(SEED)

# scikit-learn: pass the seed explicitly
# train_test_split(X, y, test_size=0.2, random_state=SEED)
# RandomForestClassifier(random_state=SEED)

For deep learning libraries, add the framework’s own seed call (for example torch.manual_seed(SEED) or tf.random.set_seed(SEED)) after importing it. Some GPU operations are not fully deterministic even with seeds, so state this in your README if small differences remain.

What a seed does not cover

  • Different library versions can give different results with the same seed.
  • Different hardware (CPU versus GPU) can change floating-point results slightly.
  • Data that changes between runs, such as a live download, breaks repeatability.
  • Parallel jobs may not be ordered the same way every run.

Illustrative walkthrough: checking a small classification project

This is a made-up scenario for explanation, not a real run or result. Suppose you build a model that predicts whether a customer will leave, using a CSV file.

  1. You create .venv, install the five packages above, and freeze the file.
  2. You set SEED = 42 and use it in the split and the model.
  3. You run the script twice and compare the printed accuracy. If both runs print the same value, the seeding is working. If they differ, look for an unseeded step such as shuffle=True without a state, or a model with no random_state.
  4. You delete .venv, reinstall from requirements.txt, and run again. A match confirms the file is complete.
  5. In the README, you record: Python version, install command, run command, seed value, and the metric you observed along with the date.

The README is what turns “it works for me” into “it works for you”.

Troubleshooting table for common Python install errors

Symptom or message Likely cause What to try
'python' is not recognized (Windows) Python not on PATH, or installed without the PATH option Try py --version; if it works use py -m venv .venv. Otherwise reinstall and tick “Add Python to PATH”.
PowerShell says running scripts is disabled when activating Execution policy blocks the activate script Use Command Prompt instead, or ask your IT admin before changing policy settings.
No matching distribution found Package has no build for your Python version, a typo, or no internet Check spelling, test your connection, and try an older Python such as 3.10 or 3.11.
ModuleNotFoundError after install Installed in a different Python than the one running your code Activate the environment, then use python -m pip install ... so pip matches the interpreter.
Jupyter cannot see your packages Notebook uses a different kernel Inside the environment run pip install ipykernel and python -m ipykernel install --user --name churn-model, then select that kernel.
Build errors mentioning a compiler or “wheel” Package tried to compile from source Upgrade pip, prefer a Python version with prebuilt wheels, or read the package’s install notes.
Could not install packages due to an OSError Permission problem or long file path Install inside a venv, not system Python, and keep the project path short.
Dependency conflict warnings Two packages need incompatible versions Start a fresh environment and install packages together in one command.
SSL or timeout errors on a campus or shared network Proxy or restricted network Try a different network, such as a mobile hotspot, or ask the network admin about proxy settings.
Different numbers after reinstalling Unpinned versions or missing seed Compare pip freeze output between machines and re-check every random step.

When asking for help, paste the full error text, your Python version, your operating system and the command you ran. Screenshots cropped to the last line make diagnosis much harder.

Netaji Subhas University, Jamshedpur: where AI internship work fits in what the university publishes

Netaji Subhas University is a state private university in Jamshedpur, Jharkhand. Its website says it was established under the Jharkhand State Private University Act, 2018. This is the Jamshedpur institution, not to be confused with Netaji Subhas University of Technology in Delhi, which is a separate university.

For a student heading into an AI internship, the relevant academic home is the School of IT. Its programme page lists BCA, BCA (Hons. / Hons. with Research), MCA and a Ph.D. in IT. The school’s About section mentions artificial intelligence alongside cyber security, software development and data analytics, but the page does not name a dedicated AI degree. So an AI internship is best described as an extension of your IT or computer applications studies, not as a separate university-recognised AI track.

The placement page says support begins from day one, with mentoring, career workshops and industry exposure, and that recruiter partnerships give access to job offers, internships and industry projects. It lists a placement cell contact at placement@nsuniv.ac.in with an office in Pokhari, Jamshedpur. The university also publishes a Training & Placement SOP on its site, but internship duration, credit and evaluation rules are not stated on the pages a student can browse, so they should be confirmed directly.

Practically, this means a reproducible Python environment, with pinned dependencies and a clear README, is something you demonstrate through your own repository. Whatever the host company asks for, keep your work portable enough that a mentor, a faculty reviewer or a placement officer can rerun it on a fresh machine.

Questions to settle with Netaji Subhas University before the internship starts

  • Ask your school office whether an outside AI internship counts toward any project or training requirement for your programme.
  • Email placement@nsuniv.ac.in to ask whether the cell issues a no-objection or introduction letter for self-found internships.
  • Check the academic calendar so internship dates avoid examination and assessment windows.
  • Ask whether a faculty reviewer expects a report or code repository, and in which format.
  • Confirm whether the university allows use of your own laptop and open-source tooling for evaluation submissions.

Final pre-submission reproducibility checklist

  • The project runs from a fresh clone and a fresh virtual environment.
  • requirements.txt is current and pinned.
  • The Python version is stated in the README.
  • All random operations use a seed set in one place.
  • Data paths are relative, not C:\Users\yourname\....
  • Large data and the .venv folder are excluded from the submission.
  • The README lists install steps, run steps and the metric you observed.
  • Notebooks are restarted and run top to bottom before saving.

Frequently Asked Questions

Do I need a virtual environment if I only use Google Colab?

Colab provides its own preinstalled environment, which can change over time. Even there, record library versions with pip freeze or pip list at the end of your notebook and note the seed so others can compare.

Should I commit the .venv folder to GitHub?

No. It is large and tied to your operating system. Commit requirements.txt and a README, and let others rebuild the environment.

Which Python version is safest for AI libraries?

Versions one or two releases behind the newest are usually the safest because libraries publish prebuilt packages for them first. Check the install page of the main library you plan to use and choose a version it supports.

Why do I get different accuracy even with the same seed?

Common causes are different library versions, GPU versus CPU execution, an unseeded step such as data shuffling, or changed input data. Compare pip freeze output and audit each random operation.

Is pip freeze enough, or should I use a tool like Poetry?

For a 14-day project, pip freeze with a clear README is enough. Tools such as Poetry or pip-tools add lock-file features that can help on longer projects, but they also add learning time you may not have.

How do I share a reproducible setup with a reviewer who uses a different operating system?

Pin your packages, state your Python version, avoid absolute paths, and mention any step that differs by system, such as the activate command. Note that some GPU or compiled packages may need different install steps on another system.

Can I use a reproducible setup from this internship in my college project?

The habits transfer directly, but whether internship work can be reused or submitted for a college requirement depends on your department and project guide. Ask them in writing before reusing any code or reports.

Related Artificial Intelligence guides

Ready to put this into practice?

Join the free two-week CareerSwami online internship in Artificial Intelligence. The internship, the offer letter and the completion certificate are free.

Start your free 2-week internship

Web Stories

Scroll to Top