我正在尝试在 FreeBSD 上为 python 3 安装“请求”模块。我使用的是 python 3.2,但我的机器上也安装了 python 2.6。
我安装了点子。
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 版本的“请求”?
- 当我运行“python”时,我得到了 2.6.6 版本。我必须明确运行“python3.2”。我需要做些什么来让 3.2 成为我的默认 python 安装吗?