【问题标题】:Can't build wheel for pandas不能为熊猫造轮子
【发布时间】:2021-06-20 09:19:09
【问题描述】:

我是编码初学者,目前正在尝试运行我在一篇研究论文中找到的一些代码(此处为 github:https://github.com/jdechalendar/tracking_emissions)。代码是在 Linux 环境中编写的,所以我下载了适用于 Windows 的 Ubuntu,第一步只是运行 setup.py 文件来下载一些包,如 numpy 和 pandas。但是,当代码涉及“为熊猫构建轮子”时,需要 25 分钟才能完成红色错误代码的 MASSIVE 块,但我在下面粘贴了两个大错误。我不明白为什么这么简单的任务这么难。

我尝试在网上寻找很多解决方案并下载了许多软件包,例如 libssl 和 libblas 和 python3-dev,升级了 setuptools 和 wheel,确保我有 gcc 等。奇怪的是我可以通过“apt-”安装 pandas get" 没有轮子,但是当我运行研究论文中的代码时,我收到“没有名为 pandas 的模块”的错误。

非常感谢任何帮助,已经解决这个问题好几天了!!

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1                                                        
----------------------------------------                                                                               
ERROR: Failed building wheel for pandas                                                                                
Running setup.py clean for pandas                                                                                    
Successfully built tracking-emissions                                                                                  
Failed to build pandas                                                                                                 Installing collected packages: pandas, tracking-emissions                                                                
Attempting uninstall: pandas                                                                                             
Found existing installation: pandas 1.2.3                                                                              
Uninstalling pandas-1.2.3:                                                                                               
Successfully uninstalled pandas-1.2.3                                                                                
Running setup.py install for pandas ... error                                                                          
ERROR: Command errored out with exit status 1:                                                                          
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install
n2fkahdv/pandas_9d8e284bb5b849b7bfb72940b77bf16f/setup.py'"'"'; __file__='"'"'/tmp/pip-install
n2fkahdv/pandas_9d8e284bb5b849b7bfb72940b77bf16f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__,
'"'"'exec'"'"'))' install --record /tmp/pip-record-86n8ifgk/install-record.txt --single-version
externally-managed --compile --install-headers /usr/local/include/python3.8/pandas                     
cwd: /tmp/pip-install-n2fkahdv/pandas_9d8e284bb5b849b7bfb72940b77bf16f/ 

【问题讨论】:

  • 这个问题类似于linux-gnu-gcc-failed,需要安装sudo apt-get install build-essential libssl-dev libffi-dev python-dev
  • @oaxacamatt 我已经尝试过了并收到了同样的错误
  • 实际上,我在 GitHub 站点中没有看到任何特别需要 Linux 的内容。这只是蟒蛇。它只在 Linux 上运行,但不需要它......为什么不下载 Python 或 Anaconda 并将其安装在我们的 Windows 机器上,然后运行 ​​.py 脚本?
  • @oaxacamatt 我没有想到,只是试了一下。但是,如何在 Anaconda 上运行诸如 makefile 之类的东西,这些东西实际上包含所有要运行的 .py 脚本?还是我必须单独运行它们?
  • Window 的 Powershell 工作了吗?

标签: python python-3.x pandas ubuntu ubuntu-20.04


【解决方案1】:

我尝试使用 Ubuntu 和 Powershell 对一堆问题进行故障排除,但两者都不起作用。由于这是 Python 的问题,我实际上最终下载了 Anaconda 并改用 Anaconda Powershell Prompt。我还下载了chocolatey,所以我可以使用命令make all。我认为问题在于,在 Ubuntu 中,我在 usr/bin/python 中使用 Python,但在 Anaconda 中使用的是 c/Users/[User]/Anaconda/Python

【讨论】:

    猜你喜欢
    • 2021-11-17
    • 1970-01-01
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 1970-01-01
    • 2020-01-10
    • 2022-07-21
    • 2018-09-24
    相关资源
    最近更新 更多