我正在尝试在FreeBSD上为Python 3安装“requests”模块。我正在使用Python 3.2,但是该机器上也安装了Python 2.6。
我已经安装了pip。
我已经安装了pip。
pip --version
pip 1.1 from /usr/local/lib/python3.2/site-packages (python 3.2)
我运行了pip install requests
我得到了一堆语法错误,从以下内容开始:
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
- 我是否错误地获取了 Python 2 版本的 "requests"?
- 当我运行 "python" 时,我得到的版本是 2.6.6。我必须明确地运行 "python3.2"。我需要做些什么才能让 3.2 成为我的默认 Python 安装程序吗?