0

我在 fedora25 上使用 django 1.11。我正在使用虚拟环境并尝试安装 misaka:pip install misaka

我收到以下错误:命令“python setup.py egg_info”在 /tmp/pip-build-fkyx6m64/misaka/ 中出现错误代码 1 失败

这是回溯:

Collecting django-misaka
  Downloading django-misaka-0.2.1.tar.gz
Collecting houdini.py (from django-misaka)
  Downloading houdini.py-0.1.0.tar.gz
Collecting misaka (from django-misaka)
  Downloading misaka-2.1.0.tar.gz (127kB)
    100% |████████████████████████████████| 133kB 317kB/s 
    Complete output from command python setup.py egg_info:
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
    gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory

        No working compiler found, or bogus compiler options
        passed to the compiler from Python's distutils module.
        See the error messages above.
        (If they are about -mno-fused-madd and you are on OS/X 10.8,
        see http://stackoverflow.com/questions/22313407/ .)
    Traceback (most recent call last):
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 156, in save_modules
        yield saved
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
        yield
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 246, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 276, in run
        return func()
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 245, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 47, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 135, in <module>
      File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 70, in ask_supports_thread
        'Topic :: Text Processing :: Markup',
      File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 52, in no_working_compiler_found
        packages=['misaka'],
    SystemExit: 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1099, in run_setup
        run_setup(setup_script, args)
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 249, in run_setup
        raise
      File "/usr/lib64/python3.5/contextlib.py", line 77, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
        yield
      File "/usr/lib64/python3.5/contextlib.py", line 77, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 168, in save_modules
        saved_exc.resume()
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 143, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/lib/python3.5/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 156, in save_modules
        yield saved
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
        yield
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 246, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 276, in run
        return func()
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 245, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 47, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 135, in <module>
      File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 70, in ask_supports_thread
        'Topic :: Text Processing :: Markup',
      File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 52, in no_working_compiler_found
        packages=['misaka'],
    SystemExit: 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-fkyx6m64/misaka/setup.py", line 76, in <module>
        cffi_modules=['build_ffi.py:ffi'],
      File "/usr/lib64/python3.5/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 348, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 394, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 826, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1098, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1110, in obtain
        return installer(requirement)
      File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 461, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 663, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 693, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 874, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1113, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1101, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fkyx6m64/misaka/
4

2 回答 2

0

我通过这种方式解决了它:

  1. 安装 conda 并提示 conda install :conda install libpython m2w64-toolchain -c msys2

  2. 通过以下方式升级您的点子:python -m pip install --upgrade pip

  3. 安装御坂:pip install misaka

于 2020-04-13T19:22:57.207 回答
0

我在使用虚拟环境时遇到了类似的问题。明确提及 pip2,这可能有效

pip2 install misaka

并且在执行时还提到了python2

python2 example.py
于 2017-07-22T14:47:27.123 回答