0

I am a beginner at coding and currently trying to run some code I found in a research paper (github here: https://github.com/jdechalendar/tracking_emissions). The code was written in a Linux environment so I downloaded Ubuntu for Windows and the first step is just running the setup.py file to download some packages like numpy and pandas. However, when the code comes to "building wheel for pandas", it takes 25 mins to finish with the MASSIVE block of red error code but I've pasted the 2 big errors below. I don't understand why such a simple task is so difficult.

I have tried looking for many solutions online and downloaded many packages like libssl and libblas and python3-dev, upgraded setuptools and wheel, made sure I have gcc, etc. The curious thing is that I can install pandas through "apt-get" without wheels but then when I run the code from the research paper, I get the error that "no module named pandas".

Any help is MUCH appreciated, been on this problem for days!!

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/ 
noobcoder
  • 1
  • 1
  • 1
  • This is question is similar to [linux-gnu-gcc-failed](https://stackoverflow.com/questions/41492878/command-x86-64-linux-gnu-gcc-failed-with-exit-status-1), where you need to install `sudo apt-get install build-essential libssl-dev libffi-dev python-dev` – mccurcio Mar 23 '21 at 17:16
  • @oaxacamatt I've already tried that and received the same error – noobcoder Mar 23 '21 at 17:46
  • Actually, I don't see anything that particularly calls for Linux in the GitHub site. It's just python. It was only run on Linux but does not require it... Why not download Python or Anaconda and install that on our windows machine then run the .py scripts? – mccurcio Mar 23 '21 at 18:31
  • @oaxacamatt I had not thought of that but just tried it. However, how do I run things like makefile on Anaconda that actually house all the .py scripts to run? Or do I have to run them individually? – noobcoder Mar 23 '21 at 19:55
  • Did Window's Powershell work? – mccurcio Mar 27 '21 at 18:36
  • @oaxacamatt Actually ended up downloading a package so I could run "make all" through Anaconda and it worked! – noobcoder Mar 28 '21 at 23:36
  • Good work, then answer your own question with an outline of your steps then get the credit. ;) – mccurcio Mar 29 '21 at 01:49

1 Answers1

0

I tried to troubleshoot a bunch using both Ubuntu and Powershell but both did not work. Since it was an issue with Python, I actually ended up downloading Anaconda and using Anaconda Powershell Prompt instead. I also downloaded chocolatey so I could use the command make all. I believe the issue was that with Ubuntu I was using the Python in usr/bin/python but with Anaconda it was c/Users/[User]/Anaconda/Python.

Dharman
  • 30,962
  • 25
  • 85
  • 135
noobcoder
  • 1
  • 1
  • 1