Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

cannot use pip to install pandas or pandas_datareader

Posted on 2016-08-15
5
Medium Priority
?
806 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 9

Accepted Solution

by:
James Bilous earned 2000 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 9

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

963 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