Netbox Upgrade Script Fails When Python3 is not installed as /usr/bin/python3 #4950

Closed
opened 2025-12-29 19:22:34 +01:00 by adam · 2 comments
Owner

Originally created by @ArcticSnowman on GitHub (May 27, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.7.0 to v2.11.12

Python version

3.6

Steps to Reproduce

install python3 somewhere other than /usr/bin/python3
Add to path
run ./upgrade

Expected Behavior

./upgrade should run using the python3 found in the PATH

Observed Behavior

]# ./upgrade.sh
Creating a new virtual environment at /var/lib/netbox-2.7.12/venv...
./upgrade.sh: line 20: /usr/bin/python3: No such file or directory
--------------------------------------------------------------------
ERROR: Failed to create the virtual environment. Check that you have
the required system packages installed and the following path is
writable: /var/lib/netbox-2.7.12/venv
--------------------------------------------------------------------
Originally created by @ArcticSnowman on GitHub (May 27, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.7.0 to v2.11.12 ### Python version 3.6 ### Steps to Reproduce install python3 somewhere other than /usr/bin/python3 Add to path run ./upgrade ### Expected Behavior ./upgrade should run using the python3 found in the PATH ### Observed Behavior ``` ]# ./upgrade.sh Creating a new virtual environment at /var/lib/netbox-2.7.12/venv... ./upgrade.sh: line 20: /usr/bin/python3: No such file or directory -------------------------------------------------------------------- ERROR: Failed to create the virtual environment. Check that you have the required system packages installed and the following path is writable: /var/lib/netbox-2.7.12/venv -------------------------------------------------------------------- ```
adam added the type: bugstatus: accepted labels 2025-12-29 19:22:34 +01:00
adam closed this issue 2025-12-29 19:22:35 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 28, 2021):

IIRC, we specify the full path to ensure that the system Python executable is used, rather the one from a virtual environment that might happen to be active. I'm not sure this really matters, though.

@jeremystretch commented on GitHub (May 28, 2021): IIRC, we specify the full path to ensure that the system Python executable is used, rather the one from a virtual environment that might happen to be active. I'm not sure this really matters, though.
Author
Owner

@thoms27 commented on GitHub (Jun 7, 2021):

Same issue with V2.11.6

@thoms27 commented on GitHub (Jun 7, 2021): Same issue with V2.11.6
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4950