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

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 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上