You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows系统下如何将自制Python模块安装到本地环境?

Installing Your Custom Python Module on Windows (From Head First Python)

Hey there! I totally get how disorienting it can be when a book uses Mac terminal commands but you're on Windows—let's break this down into simple, Windows-friendly steps that even a beginner can follow.

Step 1: Open Command Prompt or PowerShell

  • Press Win + R on your keyboard, type cmd (or powershell) and hit Enter. This opens your Windows command line tool.

Step 2: Navigate to Your Nester Folder

Your module is on the desktop in a folder called "Nester", so we need to tell the command line to go there:

  1. First, you’ll start in your user’s home directory by default when opening CMD. You can confirm this with echo %USERPROFILE%.
  2. Type cd Desktop and hit Enter—this moves you to your desktop folder.
  3. Then type cd Nester and hit Enter. Now you’re inside the folder with your setup.py and module code.

Pro tip: If you’re unsure about the folder name, type dir to see all files/folders in the current directory and double-check the spelling.

Step 3: Install the Module with pip

Now that you’re in the right folder, run one of these commands (try them in order if one doesn’t work):

  • For most standard Windows Python setups: pip install .
  • If you have multiple Python versions installed: python -m pip install . (this ensures you’re using the pip linked to your active Python installation)
  • If you get a permission error: pip install --user . (installs the module only for your user account, avoiding admin requirements)

Bonus: Development Mode (For Testing Changes)

If you plan to tweak your module code later and want those changes to take effect without reinstalling every time, use this command instead:
pip install -e .

Quick Troubleshooting Checks

  • Make sure your setup.py is actually in the Nester folder (run dir to confirm it’s listed).
  • If pip isn’t recognized as a command, you might need to add Python to your Windows PATH—just let me know if you hit this, and I’ll walk you through fixing it!

内容的提问来源于stack exchange,提问作者Icarus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:11:47