Solved

cannot use pip to install pandas or pandas_datareader

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…

895 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

12 Experts available now in Live!

Get 1:1 Help Now