Python 3.6环境下安装xlrd时提示‘pip未识别’的问题求助
Hey there! That error usually pops up because your system can't locate the pip executable—it's either missing from your system's PATH environment variable, or you're not calling it correctly for your Python 3.6 setup. Let's work through the fixes step by step:
Quick One-Time Fix
If you don't want to tweak system settings right now, you can run pip directly through your Python 3.6 executable:
- Open Command Prompt, then type this command:
python -m pip install xlrd - If even
pythonisn't recognized, use the full path to your Python 3.6 installation (replace with your actual path if you installed it elsewhere):C:\Python36\python.exe -m pip install xlrd
Permanent Fix (Add pip to System PATH)
To avoid this issue for good, add Python 3.6's Scripts folder (where pip is stored) to your system PATH:
- Right-click "This PC" → Properties → Advanced System Settings → Environment Variables.
- Under "System Variables", find the
Pathvariable and click Edit. - Click New and paste the path to your Python 3.6 Scripts folder (the default is
C:\Python36\Scripts—adjust if you chose a custom install location). - Click OK on all windows, then restart Command Prompt. Now you can just run this to install xlrd:
pip install xlrd
Verify Your Python Installation
If you still hit snags, double-check that you enabled the "Add Python to PATH" option when installing Python 3.6:
- Re-run the Python 3.6 installer, select Modify, then make sure the "Add Python to PATH" checkbox is ticked. Finish the modification process, then restart your terminal.
Tip for Multiple Python Versions
If you have multiple Python versions installed, use the Python launcher to target 3.6 specifically:
py -3.6 -m pip install xlrd
内容的提问来源于stack exchange,提问作者shan81

