从0到1,机器学习 2022-05-04 14:56 采纳率: 100%
浏览 269
已结题

feature_selector 安装不上

问题遇到的现象和发生背景

用pip工具安装feature_selector 模块,安装不上

问题相关代码,请勿粘贴截图

pip install

运行结果及报错内容

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [166 lines of output]
IMPORTANT WARNING:
pkg-config is not installed.
matplotlib may not be able to find some of its dependencies

  Edit setup.cfg to change the build options
  
  BUILDING MATPLOTLIB
              matplotlib: yes [2.1.2]
                  python: yes [3.8.1 (v3.8.1:1b293b6006, Dec 18 2019,
                          14:08:53)  [Clang 6.0 (clang-600.0.57)]]
                platform: yes [darwin]
  
  REQUIRED DEPENDENCIES AND EXTENSIONS
                   numpy: yes [version 1.21.4]
                     six: yes [using six version 1.14.0]
                dateutil: yes [using dateutil version 2.8.2]
  backports.functools_lru_cache: yes [Not required]
            subprocess32: yes [Not required]
                    pytz: yes [using pytz version 2022.1]
                  cycler: yes [cycler was not found. pip/easy_install may
                          attempt to install it after matplotlib.]
                 tornado: yes [tornado was not found. It is required for the
                          WebAgg backend. pip/easy_install may attempt to
                          install it after matplotlib.]
               pyparsing: yes [pyparsing was not found. It is required for
                          mathtext support. pip/easy_install may attempt to
                          install it after matplotlib.]
                  libagg: yes [pkg-config information for 'libagg' could not
                          be found. Using local copy.]
                freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                          could not be found.  You may need to install the
                          development package.]
                     png: no  [pkg-config information for 'libpng' could not
                          be found.]
                   qhull: yes [pkg-config information for 'libqhull' could not
                          be found. Using local copy.]
  
  OPTIONAL SUBPACKAGES
             sample_data: yes [installing]
                toolkits: yes [installing]
                   tests: no  [skipping due to configuration]
          toolkits_tests: no  [skipping due to configuration]
  
  OPTIONAL BACKEND EXTENSIONS
                  macosx: yes [installing, darwin]
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
                  qt5agg: no  [PySide2 not found; PyQt5 not found]
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
                  qt4agg: no  [PySide not found; PyQt4 not found]
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
                 gtk3agg: no  [Requires pygobject to be installed.]
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
  IMPORTANT WARNING:
      pkg-config is not installed.
      matplotlib may not be able to find some of its dependencies
               gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
                  gtkagg: no  [Requires pygtk]
                   tkagg: yes [installing; run-time loading from Python Tcl /
                          Tk]
                   wxagg: no  [requires wxPython]
                     gtk: no  [Requires pygtk]
                     agg: yes [installing]
                   cairo: no  [cairocffi or pycairo not found]
               windowing: no  [Microsoft Windows only]
  
  OPTIONAL LATEX DEPENDENCIES
                  dvipng: no
             ghostscript: no
                   latex: no
                 pdftops: no
  
  OPTIONAL PACKAGE DATA
                    dlls: no  [skipping due to configuration]
  
  ============================================================================
                          * The following required packages can not be built:
                          * freetype, png
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

我的解答思路和尝试过的方法

换了pycharm也不行
python是3.8版本的

我想要达到的结果

求解答,如何安装上去使用

  • 写回答

2条回答 默认 最新

  • 树下等苹果 2022-05-04 15:34
    关注

    不能使用pip和conda进行安装,只能手动从github下载下来,然后把feature_selector.py文件放到当前工作目录,然后再进行import操作。

    # feature-selector用法
    
    # 导入数据并创建feaure-selector实例
    import pandas as pd
    from feature_selector import FeatureSelector
    # 数据集中TARGET字段为对应样本的label
    train_labels = data.flag
    # 获取all features
    train_features = data.drop(columns='flag')
    # 创建 feature-selector 实例,并传入features 和labels
    # fs = FeatureSelector(data = train_features,lables = train_labels)
    fs = FeatureSelector(data = train_features, labels = train_labels)
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 5月12日
  • 已采纳回答 5月4日
  • 创建了问题 5月4日

悬赏问题

  • ¥15 请分析一下这个电路设计的优点🙏
  • ¥15 求视频摘要youtube和ovp数据集
  • ¥15 怎么改成输入一个要删除的数后现实剩余的数再输入一个删除的数再现实剩余的数用yes表示继续no结束程序
  • ¥15 在启动roslaunch时出现如下问题
  • ¥15 汇编语言实现加减法计算器的功能
  • ¥20 关于多单片机模块化的一些问题
  • ¥30 seata使用出现报错,其他服务找不到seata
  • ¥35 引用csv数据文件(4列1800行),通过高斯-赛德尔法拟合曲线,在选取(每五十点取1点)数据,求该数据点的曲率中心。
  • ¥20 程序只发送0X01,串口助手显示不正确,配置看了没有问题115200-8-1-no,如何解决?
  • ¥15 Google speech command 数据集获取