Jetson Nano执行installVSCodeWithPython.sh安装VS Code时触发python setup.py egg_info错误
Got it, let's break down what's causing that error and how to fix it.
The root issue is Python version compatibility: Jetson Nano usually comes with Python 3.6 pre-installed, but the setuptools_scm version being pulled in (7.0.5) uses from __future__ import annotations—a feature that wasn't added until Python 3.7. That's exactly why you're hitting the SyntaxError when the script tries to collect the black* packages.
Here are a few straightforward fixes to get past this:
Step 1: Manually install a compatible setuptools_scm version first
Before running the install script, install an older version of setuptools_scm that works with Python 3.6. Open your terminal and run:
pip install setuptools_scm==6.4.2
This version doesn't rely on the annotations future feature, so it should avoid the syntax error entirely when the script runs.
Step 2: Tweak the install script to pin dependencies
If the script is automatically pulling the latest package versions, you can edit it to force compatible versions:
- Open the script in a text editor (nano is easy for beginners):
nano installVSCodeWithPython.sh - Look for lines where
blackor its related packages are being installed. If you see a line like:
Modify it to add a version constraint forpip install black*setuptools_scm:pip install black* setuptools_scm<7
This tells pip to grab any version of setuptools_scm older than 7.0.0, which will be compatible with Python 3.6.
Step 3: Upgrade Python (optional, more advanced)
If you're okay with a more involved process, you can upgrade Python on your Jetson Nano to 3.7 or newer. This will natively support the annotations feature, but keep in mind it might require adjusting some system dependencies. Only go this route if you're comfortable troubleshooting potential conflicts.
After trying one of these steps, re-run ./installVSCodeWithPython.sh—it should now get past the lazy-object-proxy installation step without hitting that SyntaxError.
内容的提问来源于stack exchange,提问作者76 Charlotte

