Solved

cannot use pip to install pandas or pandas_datareader

Posted on 2016-08-15
5
68 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 7

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 7

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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 the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now