Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple test failed -- problem with the requests module #1

Open
xapple opened this issue Jul 29, 2018 · 2 comments
Open

Simple test failed -- problem with the requests module #1

xapple opened this issue Jul 29, 2018 · 2 comments

Comments

@xapple
Copy link

xapple commented Jul 29, 2018

I tried to test this library with the following commands:

$ pip install --user pinance
$ python -c "import pinance; print pinance.Pinance('AAL').name"

And got this error:

/Users/xapple/Library/Python/2.7/lib/python/site-packages/pinance/engine/gfinance.py in <module>()
     15 import re
     16 import urllib
---> 17 from urllib.request import Request, urlopen
     18
     19 # Human readable texts

ImportError: No module named request
@marcovisibelli
Copy link

this seems to be a problem related to your machine, you have to install requests
pip install requests

@xapple
Copy link
Author

xapple commented Aug 13, 2018

I think you didn't read the error message, because this is not linked to the requestspackage, but to the urllib package.

The correct diagnosis is the following: the issue arises because of a python2/python3 incompatibility.

The urllib.request module is part of the Python 3 standard library. In Python 2 you'd use urllib2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants