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

执行python scripts/setup.py报错:找不到文件或目录求助

Fixing "Python: can't open file 'scripts/setup.py': [Errno 2] No such file or directory"

Let’s break down why you’re hitting this error and fix it step by step:

1. Double-check your working directory

First off, make sure you’re actually inside the cloned donkey repository root. Run this command to confirm:

pwd

Your output should look something like /Users/your-username/donkey. If it doesn’t, navigate into the correct directory with:

cd donkey

It’s easy to accidentally run commands from the parent folder of the repo, which would make scripts/setup.py impossible to find.

2. Verify the scripts directory contents

Next, let’s see what’s actually in the scripts folder of the repo. Run:

ls -la scripts/

If setup.py isn’t listed here, that’s the core problem—either the project’s directory structure has changed, or the documentation you’re following is outdated. For the donkey project, it’s common for startup scripts to be named things like manage.py or start_server.py, or even to use a CLI command instead of a direct script call.

3. Use the correct startup command

If setup.py doesn’t exist in the scripts folder, try these alternatives:

  • Check if the installed donkey package has a built-in server command:
    donkey serve
    
  • If there’s a manage.py in the scripts directory, use the standard Django-style server startup:
    python scripts/manage.py runserver
    
  • If you’re still stuck, look for a README.md in the repo root—most projects keep up-to-date startup instructions there.

4. Re-sync with the latest repo code

It’s possible the version of the repo you cloned is out of date. Pull the latest changes to make sure you have the most current directory structure:

git pull origin main

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 08:26:30