
我檢查了 SVN 儲存庫,並嘗試python setup.py
在我的 Ubuntu 10.04 終端機(這是一個 Python 腳本)上執行此操作,但出現以下錯誤:
abc@def:~/Downloads/a-read-only$ python setup.py
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
我沒有使用 Python 的經驗,所以如果我能得到任何幫助,我將不勝感激。
答案1
嘗試以下命令:
python setup.py install
答案2
看起來你需要添加一個“cmd1”。
要了解它是什麼,請輸入
python setup.py --help
答案3
那你可以使用終端命令從 Ubuntu 安裝 python。嘗試使用:
sudo apt-get install python3
Python安裝成功後。您可以透過在終端機中輸入「python3」來運行 python 終端,並檢查命令是否有效。或者您可以使用以下命令運行 python 腳本:
python3 myfile.py
答案4
setup.py
也可以包含對帶有參數的 setup() 的呼叫script_args
:
from setuptools import setup, Extension
setup(ext_modules = [Extension(...)],
script_args = ['build_ext'])
雖然這裡沒有明確說明 https://setuptools.pypa.io/en/latest/deprecated/distutils/apiref.html,build_ext 指令運行時:
$ python setup.py
無需向 setup.py 提供命令。