If you haven’t already installed standard Python:
- Download and install Python from python.org.
- Ensure you check "Add Python to PATH" during installation.
To verify the installation, run:
python --version
pip --versionTo recreate your Conda environment, you need a list of installed packages:
conda list --export > conda_packages.txtThis will output all packages, but since Conda includes system-level dependencies, we should filter only Python packages.
To generate a standard requirements.txt:
conda list --export | grep -E "^(?!#|@)" | awk -F= '{print $1"=="$2}' > requirements.txtAlternatively, you can manually install only the necessary packages.
- Navigate to your project folder:
cd /path/to/project - Create a new virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows:
venv\Scripts\activate
- Mac/Linux:
source venv/bin/activate
- Windows:
To confirm activation, check that (venv) appears in the terminal prompt.
Use the generated requirements.txt to install necessary packages:
pip install -r requirements.txtIf you need Jupyter support (previously handled by Conda):
pip install jupyterlabTo install a package containing a pyproject.toml file:
pip install .If you want the package to be editable:
pip install -e . Make sure you're in your project directory with a valid
pyproject.tomlbefore running these commands.
- Open VS Code.
- Install the Python extension (if not already installed).
- Open the Command Palette (
Ctrl + Shift + P/Cmd + Shift + Pon Mac). - Search for "Python: Select Interpreter" and select your
venvinterpreter.- The path should be something like:
.venv/bin/python (Mac/Linux) .venv\Scripts\python.exe (Windows)
- The path should be something like:
If you want to stop using Anaconda completely:
- Remove Anaconda from your system’s
PATHenvironment variable. - Uninstall Anaconda (optional) via:
- Windows: Use "Add or Remove Programs".
- Mac/Linux: Run
rm -rf ~/anaconda3(orminiconda3).
- Run a script to ensure everything is working:
python your_script.py
- If you miss any packages, install them manually with:
pip install package-name
- Install standard Python and add it to
PATH. - Export Conda dependencies and convert them to
requirements.txt. - Create a virtual environment using
venv. - Activate the environment and install packages with
pip. - Set up VS Code to use the new environment.
- (Optional) Remove Anaconda from
PATHor uninstall it. - Test and refine your new setup.
This transition simplifies environment management and improves portability while keeping the benefits of virtual environments. 🚀