Win10系统Python3环境下lmfit包安装失败求助
Hey there, let's break down why you're hitting this issue and how to fix it. The core problem in your setup.py output is this critical error:
Download error on https://pypi.org/simple/uncertainties/: unknown url type: https -- Some packages may not be found!
This almost always relates to SSL/HTTPS support issues with your Anaconda Python environment rather than a pure Windows system problem. Here's how to resolve it step by step:
Step 1: Upgrade pip to the latest version
Older versions of pip often have incomplete HTTPS support. Run this command in your Anaconda prompt (run as administrator if you hit permission issues):
python -m pip install --upgrade pip
If that fails due to path conflicts, use the full path to your Anaconda pip executable:
c:\users\re090\anaconda3\scripts\pip.exe install --upgrade pip
Step 2: Check if your SSL module is working
Open a Python shell (type python in your prompt) and run this test:
import ssl
If this throws an error, your Anaconda installation is missing critical SSL components. Fix this by:
- Repairing your Anaconda install via Windows Control Panel > Programs > Programs and Features > Select Anaconda > Click "Change" > Choose "Repair"
- Or reinstalling Anaconda from scratch (grab the latest version to ensure all components are included)
Step 3: Install dependencies manually first
If pip still can't fetch the uncertainties package, download the appropriate wheel file (.whl) for your Python 3.7 environment, then install it locally:
- Grab a compatible wheel (look for a file like
uncertainties-3.1.7-py3-none-any.whl) - Run this command (replace the filename with your downloaded file):
pip install uncertainties-3.1.7-py3-none-any.whl
Once uncertainties is installed, retry installing lmfit with pip install lmfit or your original python setup.py install command.
Step 4: Use Conda instead of pip (recommended for Anaconda users)
Since you're using Anaconda, leveraging conda's package manager can bypass pip's HTTPS issues entirely. Run this in your Anaconda prompt:
conda install -c conda-forge lmfit
Conda will handle all dependencies (including uncertainties) automatically from its own repositories, which often have more reliable connectivity for Windows systems.
Why this works on other Windows 10 PCs?
Other machines likely have:
- A newer version of pip with proper HTTPS support
- A fully functional SSL module in their Python environment
- Up-to-date system SSL root certificates
Your newer PC might have had a partial Anaconda installation, missing SSL components, or outdated pip by default.
内容的提问来源于stack exchange,提问作者Tim




