Perl API错误:Bareword";SQL“U整数”;“在”期间不允许;严格subs“;使用中

Perl API错误:Bareword";SQL“U整数”;“在”期间不允许;严格subs“;使用中,perl,api,cpan,dbi,bioperl,Perl,Api,Cpan,Dbi,Bioperl,我正在尝试使用以下Perl代码连接到Ensembl API: #!/bin/perl use Bio::EnsEMBL::Registry; use DBI qw(:sql_types); my $registry = 'Bio::EnsEMBL::Registry'; $registry->load_registry_from_db( -host => 'ensembldb.ensembl.org', # altern

我正在尝试使用以下Perl代码连接到Ensembl API:

    #!/bin/perl

    use Bio::EnsEMBL::Registry;
    use DBI qw(:sql_types);


    my $registry = 'Bio::EnsEMBL::Registry';

    $registry->load_registry_from_db(
        -host => 'ensembldb.ensembl.org', # alternatively 'useastdb.ensembl.org'
        -user => 'anonymous'
    );

    my @db_adaptors = @{ $registry->get_all_DBAdaptors() };

    foreach my $db_adaptor (@db_adaptors) {
        my $db_connection = $db_adaptor->dbc();

        printf(
            "species/group\t%s/%s\ndatabase\t%s\nhost:port\t%s:%s\n\n",
            $db_adaptor->species(),   $db_adaptor->group(),
            $db_connection->dbname(), $db_connection->host(),
            $db_connection->port()
        );
    }
Bioperl和CPAN都是使用EnsemblAPI所必需的,我非常确信它们都正确安装在我的Ubuntu上。我还向PERL5LIB环境变量添加了所需的模块。尽管如此,我还是收到以下错误消息:

    Bareword "SQL_INTEGER" not allowed while "strict subs" in use at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm line 299.
    Compilation failed in require at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm line 45.
    BEGIN failed--compilation aborted at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm line 45.
    Compilation failed in require at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm line 60.
    BEGIN failed--compilation aborted at /home/src/ensembl/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm line 60.
    Compilation failed in require at /home/src/ensembl/modules/Bio/EnsEMBL/Registry.pm line 127.
    BEGIN failed--compilation aborted at /home/src/ensembl/modules/Bio/EnsEMBL/Registry.pm line 127.
以下是脚本用于连接到Ensembl数据库的注册表文件:

    Bio::EnsEMBL::Registry->load_registry_from_db(
        -host    => 'ensembldb.ensembl.org',
        -user    => 'anonymous',
        -verbose => '1'
    );

    use strict;
    use Bio::EnsEMBL::Utils::ConfigRegistry;
    use Bio::EnsEMBL::DBSQL::DBAdaptor;


    new Bio::EnsEMBL::DBSQL::DBAdaptor(
        -host    => 'ensembldb.ensembl.org',
        -user    => 'anonymous',
        -port    => '3306',
        -species => 'homo_sapiens',
        -group   => 'core',
        -dbname  => 'homo_sapiens_core_70_37'
    );

    my @aliases = ( 'H_Sapiens', 'Homo sapiens', 'human' );

    Bio::EnsEMBL::Utils::ConfigRegistry->add_alias(
        -species => 'homo_sapiens',
        -alias   => \@aliases
    );
    1

文件/home/src/ensembl/modules/Bio/ensembl/DBSQL/BaseAdaptor.pm是否有行
使用dbiqw(:sql_类型)在第299行之前?不也许您有一个旧版本的Bio::EnsEMBL::DBSQL::BaseAdaptor


也许你的DBI不是它应该的样子。perldoc-l DBI的位置是什么?对吗?您是如何安装DBI的?您没有复制“.pm”文件,是吗?

可能没有导入某些常量?问题在于您没有显示的代码中。我没有收到任何错误。不太可能是安装错误。更可能是DBI的旧版本。perl-MDBI-le'print$DBI::VERSION'的输出是什么;perl-Mstrict-MDBI=:sql_types-le'print STDOUT sql_INTEGER'
命令“perl-MDBI-le'print$DBI::VERSION”不打印任何内容。第二个命令在-e第1行使用“strict subs”时打印“Bareword”SQL_INTEGER”是不允许的。由于编译错误,-e的执行被中止。“嗯?不可能什么都不打印?!模块的版本必须在CPAN上<代码>使用DBI正在加载DBI以外的内容,这意味着您的系统上有一个垃圾
DBI.pm
。我重新安装了DBI。现在我得到一个不同的错误:“DBD::mysql初始化失败:无法通过/usr/local/lib/perl/5.14.2/DBI.pm行819上的包“DBD::mysql”找到对象方法“driver”是否安装了DBD::mysql?