当前位置: 首页 > 知识库问答 >
问题:

Pip安装Keras——命令“python setup.py egg\u info”

萧宏远
2023-03-14

我正试图安装Keras,但有扩散。我看过类似的线索,尝试过他们的解决方案,但似乎没有一个奏效。我尝试了以下方法:

pip install keras
pip install unroll 

两者都返回相同的结果,如下所示:

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Ahmad\AppData\Local\Temp\pip-build-6qx6kw9h\unroll\

下面是我pip安装Keras时的输出:

C:\Users\Ahmad\Desktop\HouseProject>pip install keras
Collecting keras
Collecting theano (from keras)
Requirement already satisfied: pyyaml in     c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages (from keras)
Requirement already satisfied: six in c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages (from keras)
Collecting scipy>=0.14 (from theano->keras)
  Using cached scipy-0.19.1.tar.gz
    Complete output from command python setup.py egg_info:
    non-existing path in 'numpy\\distutils': 'site.cfg'
    Running from numpy source directory.
    C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-    1.13.1\setup.py:367: UserWarning: Unrecognized setuptools command, proceeding     with generating Cython sources and expanding templates
      run_build = parse_setuppy_commands()
    C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-    1.13.1\numpy\distutils\system_info.py:572: UserWarning:
    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  self.calc_info()
    C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-    1.13.1\numpy\distutils\system_info.py:572: UserWarning:
    Blas (http://www.netlib.org/blas/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [blas]) or by setting
    the BLAS environment variable.
  self.calc_info()
    C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\system_info.py:572: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      self.calc_info()
    C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-    1.13.1\numpy\distutils\system_info.py:572: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      self.calc_info()
    C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-    1.13.1\numpy\distutils\system_info.py:572: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      self.calc_info()
    c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    Traceback (most recent call last):
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-    packages\setuptools\msvc.py", line 481, in _find_latest_available_vc_ver
        return self.find_available_vc_vers()[-1]
    IndexError: list index out of range

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File     "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\core.py",     line 148, in setup
        dist.run_commands()
      File     "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py",     line 955, in run_commands
        self.run_command(cmd)
      File     "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py",     line 974, in run_command
        cmd_obj.run()
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-    packages\setuptools\command\bdist_egg.py", line 152, in run
        self.run_command("egg_info")
      File     "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\cmd.py",     line 313, in run_command
        self.distribution.run_command(command)
      File     "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py",     line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-    1.13.1\numpy\distutils\command\egg_info.py", line 26, in run
      File     "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\cmd.py",     line 313, in run_command
        self.distribution.run_command(command)
      File     "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\dist.py",     line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-    1.13.1\numpy\distutils\command\build_src.py", line 148, in run
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-    1.13.1\numpy\distutils\command\build_src.py", line 159, in build_sources
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\command\build_src.py", line 294, in build_library_sources
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\command\build_src.py", line 377, in generate_sources
      File "numpy\core\setup.py", line 672, in get_mathlib_info
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\command\config.py", line 243, in try_link
        self._check_compiler()
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\command\config.py", line 51, in _check_compiler
      File     "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\_msvccompiler.py", line 197, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-    packages\setuptools\msvc.py", line 176, in msvc14_get_vc_env
        return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-    packages\setuptools\msvc.py", line 835, in __init__
        self.si = SystemInfo(self.ri, vc_ver)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\msvc.py", line 477, in __init__
        self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\msvc.py", line 484, in _find_latest_available_vc_ver
        raise distutils.errors.DistutilsPlatformError(err)
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is     required. Get it with "Microsoft Visual C++ Build Tools":     http://landinghub.visualstudio.com/visual-cpp-build-tools

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 158, in save_modules
    yield saved
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 199, in setup_context
    yield
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 254, in run_setup
    _execfile(setup_script, ns)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 49, in _execfile
    exec(code, globals, locals)
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\setup.py", line 392, in <module>
    # higher up in this file.
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\setup.py", line 384, in setup_package
    if "--force" in sys.argv:
      File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\core.py", line 169, in setup
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 1104, in run_setup
    run_setup(setup_script, args)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 257, in run_setup
    raise
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 199, in setup_context
    yield
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 170, in save_modules
    saved_exc.resume()
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 145, in resume
    six.reraise(type, exc, self._tb)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\_vendor\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 158, in save_modules
    yield saved
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 199, in setup_context
    yield
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 254, in run_setup
    _execfile(setup_script, ns)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\sandbox.py", line 49, in _execfile
    exec(code, globals, locals)
  File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\setup.py", line 392, in <module>
    # higher up in this file.
  File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\setup.py", line 384, in setup_package
    if "--force" in sys.argv:
  File "C:\Users\Ahmad\AppData\Local\Temp\easy_install-3yj2htrd\numpy-1.13.1\numpy\distutils\core.py", line 169, in setup
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\core.py", line 163, in setup
    raise SystemExit("error: " + str(msg))
SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-xgjhugze\scipy\setup.py", line 416, in <module>
    setup_package()
  File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-xgjhugze\scipy\setup.py", line 412, in setup_package
    setup(**metadata)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\distutils\core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\dist.py", line 325, in __init__
    self.fetch_build_eggs(attrs['setup_requires'])
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\dist.py", line 446, in fetch_build_eggs
    replace_conflicting=True,
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 855, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 1127, in best_match
    return self.obtain(req, installer)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 1139, in obtain
    return installer(requirement)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\dist.py", line 518, in fetch_build_egg
    return cmd.easy_install(req)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 672, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 698, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 879, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 1118, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\setuptools\command\easy_install.py", line 1106, in run_setup
    raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: Microsoft     Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools":         http://landinghub.visualstudio.com/visual-cpp-build-tools

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\Ahmad\AppData\Local\Temp\pip-build-xgjhugze\scipy\

我不知道这是否有帮助,但这是我的点数列表中的内容:

后场。weakref(1.0rc1)

中文全称:

漂白剂(1.5.0)

bs4(0.0.1)

认证(2017.7.27.1)

沙丁鱼(3.0.4)

分配(0.7.3)

EZ设置(0.9)

HTML5lib(0.9999999)

idna(2.5)

拐点(0.3.1)

降价(2.6.8)

更多itertools(3.2.0)

熊猫(0.20.3)

pip(9.0.1)

protobuf(3.3.0)

Python-dateutil(2.6.1)

pytz(2017.2)

皮亚马尔(3.12)

Quandl(3.2.0)

请求(2.17.3)

学习(0.18.2)

软件开发工具

六(1.10.0)

在线学习

tensorflow(1.2.1)

urllib3(1.21.1)

Werkzeug(0.12.2)

车轮(0.29.0)

每当我再次安装Visual studio时,都会收到此错误。

Command "c:\users\ahmad\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Ahmad\\AppData\\Local\\Temp\\pip-build-si1p7x2k\\scipy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Ahmad\AppData\Local\Temp\pip-zrxmip_u-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Ahmad\AppData\Local\Temp\pip-build-si1p7x2k\scipy\

顺便谢谢你的帮助!!

Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-si1p7x2k\scipy\setup.py", line 416, in <module>
        setup_package()
      File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-si1p7x2k\scipy\setup.py", line 412, in setup_package
        setup(**metadata)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\core.py", line 135, in setup
        config = configuration()
      File "C:\Users\Ahmad\AppData\Local\Temp\pip-build-si1p7x2k\scipy\setup.py", line 336, in configuration
        config.add_subpackage('scipy')
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
        caller_level = 2)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
        caller_level = caller_level + 1)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\setup.py", line 15, in configuration
        config.add_subpackage('linalg')
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 1029, in add_subpackage
        caller_level = 2)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 998, in get_subpackage
        caller_level = caller_level + 1)
      File "c:\users\ahmad\appdata\local\programs\python\python35\lib\site-packages\numpy\distutils\misc_util.py", line 935, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\linalg\setup.py", line 20, in configuration
        raise NotFoundError('no lapack/blas resources found')
    numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

共有1个答案

裴理
2023-03-14

我解决了这个问题。。。那是因为我没有用蟒蛇。我用anaconda卸载并重新安装了它,它成功了:)

 类似资料:
  • 我对python语音识别问题和音频库有问题 这是在windows系统上 C:\用户\戴尔

  • 问题内容: 因此,我安装了 Anaconda ,一切正常。安装后,我决定切换到。我现在得到: 尝试使用或安装时 5.0.5 我已添加到我的 我想念的是什么? 问题答案: 看来我的PATH在我的文件中已损坏。 打开并添加: h!好吧,这将解释一切。我怎么想念那个小分号?已更改: 我们现在很好。

  • Python 和系统版本支持列表 pip 可以在以下版本的 CPython 下运行:2.6, 2.7, 3.1, 3.2, 3.3, 3.4 和 pypy. pip 可以在 Unix/Linux, OS X 和 Windows 系统中运行. Note Python 2.5在 v1.3.1版本后支持, Python 2.4在v1.1版本后支持. 使用脚本安装和升级pip 要安装或升级pip,需要下载

  • 我在mac os X Mojave 10.14.6上运行。我是一个命令行新手,我很迷茫。我看到这篇文章,并使用brew安装postgresql,但这似乎并没有解决我的任何问题。

  • 问题内容: 它可以安装NumPy的与PIP使用。 SciPy是否有类似的可能性?(这样做无效。) 更新资料 SciPy软件包现在可用于安装! 问题答案: 试图指出其在Python Package Index中 列出的问题,该点会进行搜索。 但是,一切并没有丢失。可以从Subversion(SVN),Git,Mercurial和Bazaar存储库安装。SciPy使用SVN: 更新(12-2012):

  • 我正在尝试在新项目文件夹中安装新的虚拟环境,但它没有在虚拟环境中安装。 下面是bash日志: 这里的问题是没有安装在中。我的问题是-这正常吗?我应该自己安装吗?如果是这样,我将如何做到这一点,以便当我运行类似于的东西时,安装在中? 顺便说一句,我想把所有东西都放在2.7里是我的计算机用户名。