...
soup = BeautifulSoup(html, "lxml")
File "/Library/Python/2.7/site-packages/bs4/__init__.py", line 152, in __init__
% ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
Run Code Online (Sandbox Code Playgroud)
以上输出在我的终端上.我在Mac OS 10.7.x上.我有Python 2.7.1,并按照本教程获得Beautiful Soup和lxml,它们都已成功安装并使用位于此处的单独测试文件.在导致此错误的Python脚本中,我包含了这一行:
from pageCrawler import comparePages
在pageCrawler文件中,我包含以下两行:
from bs4 import BeautifulSoup
from urllib2 import urlopen
任何有关确定问题是什么以及如何解决问题的帮助都将不胜感激.
我是Swift后端的新手,并且认为我会快速使用Vapor在一个侧面项目上运行起来......我跑了vapor new WebServer --template=auth-template
,现在我正在试图找出类似return \.email
意味着什么.有关更多上下文,我正在查看WebServer> Sources> App> Models> Users.swift:
import Authentication
import FluentSQLite
import Vapor
/// Allows users to be verified by basic / password auth middleware.
extension User: PasswordAuthenticatable {
/// See `PasswordAuthenticatable`.
static var usernameKey: WritableKeyPath<User, String> {
return \.email
}
// ...
}
Run Code Online (Sandbox Code Playgroud)
这是User类的定义:
/// A registered user, capable of owning todo items.
final class User: SQLiteModel {
// {omit extra code} ...
var email: String
// {omit extra code} ...
/// Creates …
Run Code Online (Sandbox Code Playgroud)