python - 无法使用 pip 安装 Pandas

标签 python python-3.x pandas

安装时 pandas使用pip,我收到错误。有人可以帮我解决这个问题。我在 windows10 上使用 python 3.4。

set build\lib.win-amd64-3.4\pandas/_version.py to '0.22.0'
    running build_ext
    building 'pandas._libs.hashing' extension
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\sthakur1\AppData\Local\Temp\pip-build-2lweg8a9\pandas\setup.py", line 743, in <module>
        **setuptools_kwargs)
      File "C:\Python34\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Python34\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\Python34\lib\distutils\command\install.py", line 539, in run
        self.run_command('build')
      File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Python34\lib\distutils\command\build.py", line 126, in run
        self.run_command(cmd_name)
      File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Python34\lib\distutils\command\build_ext.py", line 339, in run
        self.build_extensions()
      File "C:\Users\sthakur1\AppData\Local\Temp\pip-build-2lweg8a9\pandas\setup.py", line 385, in build_extensions
        build_ext.build_extensions(self)
      File "C:\Users\sthakur1\AppData\Local\Temp\pip-build-2lweg8a9\pandas\setup.py", line 161, in build_extensions
        _build_ext.build_extensions(self)
      File "C:\Python34\lib\distutils\command\build_ext.py", line 448, in build_extensions
        self.build_extension(ext)
      File "C:\Python34\lib\distutils\command\build_ext.py", line 503, in build_extension
        depends=ext.depends)
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 460, in compile
        self.initialize()
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 371, in initialize
        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "C:\Python34\lib\site-packages\setuptools\msvc9_support.py", line 52, in query_vcvarsall
        return unpatched['query_vcvarsall'](version, *args, **kwargs)
      File "C:\Python34\lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall
        raise ValueError(str(list(result.keys())))
    ValueError: ['path']

    ----------------------------------------
Command "C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\sthakur1\\AppData\\Local\\Temp\\pip-build-2lweg8a9\\pandas\\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\sthakur1\AppData\Local\Temp\pip-todgu5lt-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\sthakur1\AppData\Local\Temp\pip-build-2lweg8a9\pandas\

最佳答案

事实证明,在 python 3.4 上使用 pip 安装 pandas 时,这是一个常见问题。这实际上是 pandas 包开发人员确认的一个已知错误
https://github.com/pandas-dev/pandas/issues/20775

最简单的解决方案应该是:

pip install 'pandas<0.21'

关于python - 无法使用 pip 安装 Pandas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49554622/

相关文章:

python - 如何让 Userb 第一条消息给我?下面的代码有助于获取最新消息。我想要该用户的第一条消息给我

python - 如何在 python 3 中同时按降序和字母顺序对元组列表进行排序?

python - Dynamodb 返回项目的节点或字符串格式错误

python - 我在读取 json 文件中的信息时遇到问题

Python pandas如何按行扫描包含的字符串?

python Pandas : Importing stacked dictionary of lists to create multi-indexed DataFrame

python - 在数据框中应用单元函数

python - 如何使用 Python 格式处理空值

python - 我在 python 2.7 中用循环搞乱 turtle 导入, turtle 不会移动

python - 使用 urllib 而不是 http.client 登录网站