【问题标题】:PyPotrace pip Install Error on Jupyter NotebookJupyter Notebook 上的 PyPotrace pip 安装错误
【发布时间】:2020-12-22 16:03:44
【问题描述】:

我正在尝试在我的 jupyter notebook 虚拟环境中安装 potrace,但我遇到了这个错误代码。我在 jupyter notebook 上四处寻找任何已知的修复程序,但我找不到,有人知道如何解决这个问题吗?

根据第一条评论:我重新安装了 pkg-config(通过 brew)并重新运行了该程序,但不幸的是没有解决问题。

错误代码:

pip install pypotrace

Collecting pypotrace
  Using cached pypotrace-0.2.tar.gz (26 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/user/.local/share/virtualenvs/user-c-cRme8X/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/setup.py'"'"'; __file__='"'"'/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/pip-egg-info
         cwd: /private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/
    Complete output (25 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/setup.py", line 4, in <module>
        setup()
      File "/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/cysetuptools.py", line 149, in setup
        parsed_setup_cfg = parse_setup_cfg(fp, cythonize=cythonize)
      File "/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/cysetuptools.py", line 222, in parse_setup_cfg
        return _expand_cython_modules(config, cythonize, pkg_config, base_dir)
      File "/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/cysetuptools.py", line 230, in _expand_cython_modules
        module_dict = _expand_one_cython_module(config, section, cythonize,
      File "/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/cysetuptools.py", line 239, in _expand_one_cython_module
        _expand_pkg_config_pkgs(config, section, pkg_config)
      File "/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/cysetuptools.py", line 299, in _expand_pkg_config_pkgs
        extra_compile_args = pkg_config(pkg_names, '--cflags', env)
      File "/private/var/folders/c0/fx27s5mn44d8wj3trxnn_0940000gn/T/pip-install-d3s_0svw/pypotrace/cysetuptools.py", line 308, in _run_pkg_config
        return subprocess.check_output(['pkg-config', command] + pkg_names,
      File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 411, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 489, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'pkg-config'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

感谢我能得到的任何帮助!

【问题讨论】:

    标签: python-3.x pip jupyter-notebook potrace


    【解决方案1】:

    您的错误表明它缺少 pkg-config 包。 尝试使用:sudo apt install -y pkg-config (linux) 或 brew install pkg-config (MacOS) 安装它

    【讨论】:

    • 您好,感谢您的回复。我在 pkg-config 上是最新的,我尝试重新安装 pkg-config 并重新运行 pip 安装。不幸的是,这并没有解决问题。再次感谢您的意见。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-12-01
    • 1970-01-01
    • 2018-04-10
    • 2018-06-29
    • 2020-07-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多