Python 错误:尝试安装 pyglet 时未提供任何命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19672690/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error: No Commands supplied when trying to install pyglet
提问by Hissing Cockroach
I have downloaded pyglet, but when I run the "setup.py" thing, it just says this in the command line:
我已经下载了 pyglet,但是当我运行“setup.py”时,它只是在命令行中这样说:
Traceback (most recent call last):
File "C:\PythonX\Include\pyglet\pyglet-1.1.4\setup.py", line 285, in
setup(**setup_info)
File "C:\Python27\lib\distutils\core.py", line 140, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: 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
回溯(最近一次调用最后一次):
文件“C:\PythonX\Include\pyglet\pyglet-1.1.4\setup.py”,第 285 行,在
setup(**setup_info)
文件“C:\Python27\lib\distutils\core.py”,第 140 行,在设置中
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit:用法:setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
或: setup.py --help [cmd1 cmd2 ...]
或: setup.py --help-commands
或: setup.py cmd --help
错误:未提供命令
How do I fix this error and install pyglet?
如何修复此错误并安装 pyglet?
回答by Burhan Khalid
If you just did python setup.py
, you'll get this - you need to type python setup.py build
followed by python setup.py install
.
如果你刚刚这样做python setup.py
,你会得到这个 - 你需要输入python setup.py build
后跟python setup.py install
.
As you are on Windows; even the above commands may not work correctly. In that case, you can download the Windows installer versionwhich will install the library to your default system Python.
就像你在 Windows 上一样;即使上述命令也可能无法正常工作。在这种情况下,您可以下载 Windows 安装程序版本,该版本会将库安装到您的默认系统 Python。
回答by Hypothetical inthe Clavicle
Just checked the pyglet website, there is an msi installer found on their main page:
刚刚查看了 pyglet 网站,在其主页上找到了一个 msi 安装程序:
http://pyglet.googlecode.com/files/pyglet-1.1.4.msi
http://pyglet.googlecode.com/files/pyglet-1.1.4.msi
You'll also need to install a recent version of python
您还需要安装最新版本的python
Here's the 64 bit installer:
这是 64 位安装程序:
http://www.python.org/ftp/python/3.3.2/python-3.3.2.amd64.msi
http://www.python.org/ftp/python/3.3.2/python-3.3.2.amd64.msi
and the 32 bit installer:
和 32 位安装程序:
回答by Kindson Munonye Kany
I had the same problem. It worked fine when i installed on my desktop but when i wanted to install on my laptop it gave me the error message. Solution: Remove Python installation and reinstall again then proceed with setup of django. * First run the command to build: setup.py build * then run the command to install: setup.py install
我有同样的问题。当我安装在台式机上时它运行良好,但是当我想安装在我的笔记本电脑上时,它给了我错误消息。解决方案:删除Python安装并重新安装,然后继续安装django。* 先运行命令构建:setup.py build * 然后运行命令安装:setup.py install
This would solve your problem. But if it persists, get the msi installer
这将解决您的问题。但如果它仍然存在,请获取 msi 安装程序
回答by Saurabh
Try this if trying on Windows7: Add environment variable in windows Windows+Pause > Advanced Sys Settings > Environment Variables Add New under system variables: Variable: Python34 Value: c:\Python34\python.py (or whereever u have installed Python)
如果在 Windows7 上尝试,请尝试此操作:在 Windows 中添加环境变量 Windows+Pause > Advanced Sys Settings > Environment Variables Add New under system variables: Variable: Python34 Value: c:\Python34\python.py (or where you have installed Python)
then run using cmd: c:\Python34>python setup_bs4.py install (setup_bs4.py-> is BS4 setup file copied here)
然后使用cmd运行:c:\Python34>python setup_bs4.py install(setup_bs4.py->是BS4安装文件复制到这里)
and done... :) Hope it helps.
并完成... :) 希望它有所帮助。