How to Make Anaconda pip as the Default pip

Abstract: Resolve ModuleNotFoundError by ensuring pip installs packages into the active conda environment instead of a conflicting system Python installation.

Created: 2026-10-24 by
To make Anaconda's pip the default pip, you must ensure that your system's PATH environment variable prioritizes the Anaconda installation directory over other Python installations. This prevents conflicts where the system-wide pip installs packages into a different environment than the one you are actively using in your terminal or IDE.

Why Default pip Matters

When you have multiple Python installations on your machine—such as the one provided by your operating system and another from Anaconda—running pip install package_name can lead to confusion. The system might use the OS-level pip instead of the Anaconda pip. This results in packages being installed in a location that is not accessible when you activate your conda environment. Consequently, scripts running within your conda environment will fail with ModuleNotFoundError because the dependencies were never actually added to the active environment.

By forcing the system to use Anaconda's pip, you guarantee that every package you install via pip lands in the correct place: inside your current conda environment. This simplifies dependency management and ensures reproducibility across different machines or CI/CD pipelines that rely on specific package versions managed by conda.

Verifying Your Current Setup

Before making changes, it is crucial to understand which pip is currently being executed. Open your terminal and run the following command:

which pip

On Linux or macOS, this will return the path to the executable. On Windows, use where pip. If the output points to a directory like /usr/bin/pip or C:\Python39\Scripts\pip.exe, then you are not using the Anaconda version. You should see a path containing anaconda3 or miniconda3 if Anaconda is already correctly positioned in your PATH. If it does not, proceed with the steps below to rectify the order.

Configuring PATH on Linux and macOS

The most robust way to set Anaconda's pip as the default is to modify your shell configuration file. For Bash users, this is typically ~/.bashrc; for Zsh users (common on newer macOS versions), it is ~/.zshrc.

  1. Open your terminal and edit the appropriate config file using a text editor like nano or vim.
  2. Add the following line at the end of the file, replacing the path with your actual Anaconda installation directory if necessary:
export PATH="/home/your_username/anaconda3/bin:$PATH"

This command prepends the Anaconda bin directory to the existing PATH. Because the shell searches directories from left to right, the first pip it finds will be the one in the Anaconda folder. After saving the file, reload your configuration by running source ~/.bashrc (or source ~/.zshrc). Verify the change by running which pip again; it should now point to the Anaconda directory.

Configuring PATH on Windows

Windows handles environment variables differently. You need to adjust the user or system PATH variables through the GUI.

  1. Search for "Environment Variables" in the Start menu and select "Edit the system environment variables".
  2. Click on the "Environment Variables..." button at the bottom.
  3. In the "User variables" section (recommended) or "System variables", find the entry named Path and click "Edit".
  4. Add a new entry for your Anaconda installation path, typically something like C:\Users\YourName\Anaconda3\Scripts or C:\Users\YourName\Anaconda3\Library\mingw-w64\bin depending on your setup. Ensure this entry appears above any other Python paths in the list.
  5. Click OK to save all changes. Restart any open command prompts or PowerShell windows for the changes to take effect.

Alternative: Using Conda-Forge Pip Integration

If you prefer not to manipulate global PATH settings, you can rely on conda's built-in ability to manage pip packages. When you create a new environment, you can explicitly tell conda to use its own pip channel. However, for most users, simply ensuring the PATH is correct is the most straightforward solution. It avoids the complexity of managing separate package sources and reduces the likelihood of "environment pollution" where packages are scattered across multiple locations.

For those interested in how package installation interacts with integrated development environments, you might also want to check out Does Installing Flask Python Package within PyCharm Create Duplicate Entries on My Hard Drive? to understand how IDEs handle these paths.

Frequently Asked Questions

What happens if I don't fix the default pip?

If you do not fix the default pip, packages installed via pip install may go into your system Python directory rather than your active conda environment. This leads to errors when you try to import those libraries in your conda-based projects because they are physically located elsewhere.

Can I use conda to install pip packages instead?

Yes, you can use conda install --channel conda-forge package_name for many common libraries. However, not all packages are available on conda-forge, so knowing how to configure pip remains essential for accessing the full breadth of the Python ecosystem.

How do I switch back to the system pip if needed?

To temporarily use the system pip, you can specify the full path to the system pip executable directly in your command, such as /usr/bin/pip install package. Alternatively, you can remove the Anaconda path from your temporary session by unsetting the modified PATH variable, though this is rarely necessary for casual usage.

Does this affect Jupyter Notebooks?

Jupyter notebooks usually detect kernels based on the environment they were launched from. If you launch Jupyter from an activated conda environment, it will use the pip-installed packages from that environment regardless of the global default. However, ensuring the default pip is correct helps prevent confusion when debugging kernel issues locally.

Is it safe to delete the old pip?

No, you should not delete the system pip unless you are certain no other applications depend on it. Removing it can break system tools that rely on Python. Instead, just ensuring Anaconda's pip comes first in the PATH is sufficient and safer.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More