Python – Command “python setup.py egg_info” failed with error code 1 /tmp/pip-build-21ft0H/pandas

Here is the solution how to fix the error when you trying to install Pandas

Python - Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-21ft0H/pandas

First you need to uninstall all the Pythons (I knew it’s a bad idea but it works).

yum remove python

Then install python 2.7.10 using these commands.

wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
tar -xvzf Python-2.7.10.tgz
cd Python-2.7.10
make install

Make sure your python 2.7.10 installed in your system.

python -V

After that you need to install python 2.7.5 via RPM.

rpm -i ftp://195.220.108.108/linux/centos/7.1.1503/updates/x86_64/Packages/python-2.7.5-18.el7_1.1.x86_64.rpm

Install Pandas package via pip

sudo pip install pandas
sudo pip install pandas.

sudo pip install pandas.

Voila!! It’s done!!

Calculate age from birth date using Swift

Here is how to calculate age from birth date using Swift.

import UIKit

class _ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let myDOB = NSCalendar.currentCalendar().dateWithEra(1, year: 1970, month: 09, day: 10, hour: 0, minute: 0, second: 0, nanosecond: 0)!
        let myAge = myDOB.age
        println(self.calculateAge(myDOB))
    }

    func calculateAge (birthday: NSDate) -> Int {
        return NSCalendar.currentCalendar().components(.CalendarUnitYear, fromDate: birthday, toDate: NSDate(), options: nil).year
    }

}

extension NSDate {
    var age:Int {
        return NSCalendar.currentCalendar().components(.CalendarUnitYear, fromDate: self, toDate: NSDate(), options: nil).year
    }
}

Set ANT_HOME on Windows

Ant is a favorite build tool for most of front-end developers & is an excellent choice for JavaScript also. Ant install is like a breeze on MAC but is a bit tricky on Windows. The instructions below: (For windows Vista and above)

apache ant

apache ant

Download apache-ant-1.9.4-bin.zip from http://ant.apache.org/bindownload.cgi. After download finish, extract in C partition.

Right click on My Computer.

Click the Advanced System Settings, and then click the Environment Variables button.

Under System Variables, select New to create the ANT_HOME environment variable.

Set the variable name to ANT_HOME and the variable value to apache-ant-1.9.4-bin and click OK.

Add the apache-ant-1.9.4-bin/bin directory to your Windows path: ;C:\apache-ant-1.9.4-bin/bin

Click OK and then click OK again.

To test the setting, type ant at a command prompt and press Return. If a Build not found error message appears, you have correctly installed Ant. If you do not see an error message, check the environment variable settings and make sure they are pointing to the correct directory locations.