html 1.13 包安装
我从 Python 站点 下载了 html 1.13 包,并按照说明双击了 install.bat
并安装了它。我还将目录 C:\Python26\HTML.py-0.04
添加到 PYTHONPATH
中。但是当我尝试导入模块时,
>>> from html import HTML
我仍然得到 ImportError: No module named html
有人可以帮助我理解我做错了什么吗?谢谢。
I downloaded html 1.13 package from Python site and as per instructions I doubleclicked on install.bat
and installed it. I also added the directory C:\Python26\HTML.py-0.04
to PYTHONPATH
. But when I try to import the module with
>>> from html import HTML
I still get ImportError: No module named html
Can someone help me understand what I am doing wrong? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
常见的安装问题。
如果它安装到标准目录 site-packages 中并且它已经在路径中,则不需要将其添加到 PYTHONPATH 中。
检查默认搜索路径中应该有一个 html.. 文件夹: lib\site-packages
C:\Python26\lib\site-packages\
如果找到该文件夹,那么导入应该会自动进行。如果没有找到它,则意味着它没有正确安装。要查看您的问题,请从命令行运行 install.bat 并检查错误。
它增加了模块文件的默认搜索路径。通常,您不想安装,只需指向自定义目录,以便 python 可以从那里导入模块。
Usual installation issues.
you don't need to add it to PYTHONPATH if it is installed into standard directory site-packages and it would already be in the path.
check out there should be a html.. folder in default search path : lib\site-packages
C:\Python26\lib\site-packages\
If you find the folder then your import should work automatically. If you do not find it, that means it did not install properly. To see your issues, run install.bat from command line and check out the errors.
It augments the default search path for module files. This is usually when, you do not want to install and simply point to custom directory so that python can import modules from there.