I'm trying to get the "requests" module installed for python 3 on FreeBSD. I'm using python 3.2, but I also have python 2.6 installed on the machine.
I got pip installed.
pip --version
pip 1.1 from /usr/local/lib/python3.2/site-packages (python 3.2)
I ran pip install requests
I got a bunch of syntax errors, starting with:
File "/usr/local/lib/python3.2/site-packages/requests/packages/chardet/chardistribution.py", line 48
self._mDone = constants.False # If this flag is set to constants.True, detection is done and conclusion has been made
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.2/site-packages/requests/packages/chardet/charsetgroupprober.py", line 44
prober.active = constants.True
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.2/site-packages/requests/packages/chardet/constants.py", line 46
False = __builtin__.False
Requests for some reason includes a lot of other packages, like oauthlib and chardet. But instead of just depending on them, so they get installed by pip when you install requests, the setup.py of requests are trying to install the packages as they are included. This fails under Python 3 for some reason.
However, the requests module itself seems to get installed properly anyway. Therefore all you should need to do is to also do
pip install chardet2 urllib3
to install the missing libraries. Also report the inclusion of third-party libraries as a bug in requests. That's not how to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With