Solved

cannot use pip to install pandas or pandas_datareader

Posted on 2016-08-15
5
459 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

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 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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

Sequence is something that used to store data in it in very simple words. Let us just create a list first. To create a list first of all we need to give a name to our list which I have taken as “COURSE” followed by equals sign and finally enclosed …
Dictionaries contain key:value pairs. Which means a collection of tuples with an attribute name and an assigned value to it. The semicolon present in between each key and values and attribute with values are delimited with a comma.  In python we can…
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…
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…
Suggested Courses

623 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