gpt4 book ai didi

python - bin/python3 : cannot execute binary file: Exec format error

转载 作者:太空宇宙 更新时间:2023-11-03 20:29:55 72 4
gpt4 key购买 nike

我刚刚创建了一个新的 django 项目,并将其推送到 git,现在我尝试使用 Digital ocean 来部署它。

我安装了所有必需的东西,例如 pip、python 等,但我无法使 python manage.py runserver 工作。

((g-v)是我的虚拟环境,所以这不是问题。)

它抛出此错误:

(g-v) root@ubuntu-s-4vcpu-8gb-blr1-01:/home/g-v/src# python manage.py runserver
File "manage.py", line 14
) from exc
^
SyntaxError: invalid syntax

我读了一些建议尝试 python3 manage.py runserver 的帖子,但当我尝试时,我收到此错误:

(g-v) root@ubuntu-s-4vcpu-8gb-blr1-01:/home/g-v/src# python3 manage.py runserver
-bash: /home/g-v/bin/python3: cannot execute binary file: Exec format error

我的pip list命令输出:

(g-v) root@ubuntu-s-4vcpu-8gb-blr1-01:/home/g-v/src# pip list
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package Version
----------------------------- ----------
astroid 1.6.6
autopep8 1.4.4
backports.functools-lru-cache 1.5
certifi 2019.6.16
configparser 3.7.4
Django 1.11.23
enum34 1.1.6
futures 3.2.0
isort 4.3.21
lazy-object-proxy 1.4.1
mccabe 0.6.1
pip 19.2.2
pipenv 2018.11.26
pkg-resources 0.0.0
pycodestyle 2.5.0
Pygments 2.4.2
pylint 1.9.4
pytz 2019.2
setuptools 41.1.0
singledispatch 3.4.0.3
six 1.12.0
typing 3.7.4
virtualenv 16.7.3
virtualenv-clone 0.5.3
wheel 0.33.6
wrapt 1.11.2

最佳答案

当我忘记打开 venv 时,我观察到了这样的错误。

尝试 source ./path-to-venv/bin/activate 并重试 manage.py runserver 命令。

关于python - bin/python3 : cannot execute binary file: Exec format error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57569152/

72 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com