简体   繁体   English

导入媒体在Python中不起作用

[英]import media does not work in Python

I am reading a book about python. 我正在读一本关于python的书。 There is a sample. 有一个样本。 The first line is: 第一行是:

import media

I am trying to do the same, but the error like below 我正在尝试做同样的事情,但如下所示的错误

Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    import media
ImportError: No module named media

I want to know, is the media a default library? 我想知道,媒体是默认库吗?

Best Regards, 最好的祝福,

Looks like you're using this book (mentioning it specifically would have made it easier to identify than just saying "a book", BTW;-). 看来您正在使用这本书 (BTW;-专门提及它会比说一本书更容易识别。) Per this thread , you need to install some modules as documented here , and possibly the pygraphics package. 通过此线程 ,您需要安装此处记录的某些模块,以及可能的pygraphics软件包。 Doesn't the book itself explain that, in an introduction or maybe in an appendix? 这本书本身不是在引言或附录中对此进行解释吗?

http://code.google.com/p/pygraphics/wiki/MacInstall http://code.google.com/p/pygraphics/wiki/MacInstall

PyGraphics (which includes the 'media' module) installs via the package included with the code for the Practical Programming book but isn't currently usable on OSX 10.6 Snow Leopard PyGraphics(包括“媒体”模块)通过“实用编程”书的代码随附的软件包进行安装,但目前在OSX 10.6 Snow Leopard上不可用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM