Solved

cannot use pip to install pandas or pandas_datareader

Posted on 2016-08-15
5
114 Views
Last Modified: 2016-10-18
I want to set up a trading analysis system using python. when I tried to install pandas, it through me into the following error.

I guess my pip may not be installed well. Experts here, could you please give me some advise?

thank you in advance.

[jyu@jenkins-test ~]$ pip install pandas
Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named 'pkg_resources'
[jyu@jenkins-test ~]$ pip install pandas_datareader
Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named 'pkg_resources'
[jyu@jenkins-test ~]$ vi /usr/bin/pip
[jyu@jenkins-test ~]$ cat /usr/bin/pip
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==7.1.0','console_scripts','pip'
__requires__ = 'pip==7.1.0'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('pip==7.1.0', 'console_scripts', 'pip')()
    )
[jyu@jenkins-test ~]$
0
Comment
Question by:Jason Yu
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
James Bilous earned 500 total points
ID: 41756781
0
 

Author Comment

by:Jason Yu
ID: 41760286
I got the following error when I was following your link:


root@jenkins-test:/home/jyu$ ls -alt | grep ez
-rw-r--r--  1 root root       12402 Jun  2 13:15 ez_setup.py
root@jenkins-test:/home/jyu$ python ez_setup.py
Traceback (most recent call last):
  File "ez_setup.py", line 426, in <module>
    sys.exit(main())
  File "ez_setup.py", line 422, in main
    archive = download_setuptools(**_download_args(options))
  File "ez_setup.py", line 337, in download_setuptools
    version = _resolve_version(version)
  File "ez_setup.py", line 358, in _resolve_version
    resp = urlopen(meta_url)
  File "/usr/local/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.5/urllib/request.py", line 489, in _open
    'unknown_open', req)
  File "/usr/local/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.5/urllib/request.py", line 1324, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: https>
root@jenkins-test:/home/jyu$


Please help.
0
 
LVL 8

Expert Comment

by:James Bilous
ID: 41760293
Your python installation seems to be very broken - usually SSL is included in the python install. How did you install it? I would uninstall python and reinstall it from python.org
0
 

Author Comment

by:Jason Yu
ID: 41760298
got it, let me try it again.
0
 

Author Comment

by:Jason Yu
ID: 41760350
I think I messed up with the system. I tried to delete all files with python*, and now even the yum tool doesn't work.

root@jenkins-test:/tmp/Python-3.6.0a4$ yum install lzma
bash: /usr/bin/yum: /usr/bin/python2.7: bad interpreter: No such file or directory
root@jenkins-test:/tmp/Python-3.6.0a4$


I installed the newest python binary package, but when I run it, it doesn't find it.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing Python 2.7.3 version on Windows operating system For installing Python first we need to download Python's latest version from URL" www.python.org " You can also get information on Python scripting language from the above mentioned we…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question