2

i tried to install pandas in ubuntu but there is problem.
i already install numpy and go for pandas

kcn@vaio :~$ sudo pip install pandas

The directory '/home/kcn/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/kcn/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pandas
/usr/local/lib/python2.7/dist-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see "https//urllib3.readthedocs.org/en/latest"/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading pandas-0.18.1.tar.gz (7.3MB)
    100% |████████████████████████████████| 7.3MB 97kB/s 
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /usr/local/lib/python2.7/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in /usr/local/lib/python2.7/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /usr/lib/python2.7/dist-packages (from python-dateutil->pandas)
Installing collected packages: pandas
  Running setup.py install for pandas.../   #it took 20 min then.. 
 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qXBFie/pandas/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-icD0t5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-qXBFie/pandas/
/usr/local/lib/python2.7/dist-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Anthony E
  • 11,072
  • 2
  • 24
  • 44
subash
  • 51
  • 1
  • 7

3 Answers3

3

I got this answer by my self
Actually in Ubuntu there are two version of Python already installed
so when pip install we have to do like this
first confirm your which python you are using by this python -version then make sure your desire python version by like this: alias python=python3 for 3 or alias python=python2 for 2 and it means you have got 2 pip version i.e pip for python version2 pip3 for python version3. if you wanted to install pandas for python 2.7 you just need to sudo pip install pandas
if you wantes to install pandas for python 3 you just need to sudo pip3 install pandas
after installing pandas if you want to compile your program in 2.7 you do the same
alias python=python2or vice versa to check ther version in terminal write >>python
https://askubuntu.com/questions/320996/make-default-python-command-to-use-python-3
this answer provide more information about this problem.

Community
  • 1
  • 1
subash
  • 51
  • 1
  • 7
1

Better not mess up with the system python. Use pip install pandas --user instead. Or use a virtualenv.

ev-br
  • 24,968
  • 9
  • 65
  • 78
  • **pip install pandas --user** having same problem.... but i get install virtualenv and i am confusing with the next step?? – – subash May 17 '16 at 05:38
0

May be give this a try. It happens when you don't have the Python dev tools installed so the package fails to compile whether you are on v2.7 or 3.

sudo apt-get install python-dev
Anuj
  • 149
  • 2
  • 11