2
我有一個raspberri Pi 2 B.我正在學習python並嘗試使用請求庫。Raspberry Pi 2 B - Python 3.2,安裝pip3.2,但不能導入庫
我有python3和python3.2:
[email protected] ~/python_programming $ python3
python3 python3.2-config python3.2mu-config python3mu
python3.2 python3.2mu python3-config python3mu-config
我已經安裝了PIP:
[email protected] ~/python_programming $ sudo apt-get install python3-pip
[email protected] ~/python_programming $ pip-3.2 --version
pip 1.1 from /usr/lib/python3/dist-packages (python 3.2)
當我嘗試安裝請求庫和我得到:
[email protected] ~/python_programming $ pip-3.2 install --user requests
Requirement already satisfied (use --upgrade to upgrade): requests in /home/pi/.local/lib/python3.2/site-packages
Cleaning up...
運行解釋(python3或python3.2),並試圖導入請求庫觸發以下錯誤:
[email protected] ~/python_programming $ python3
Python 3.2.3 (default, Mar 1 2013, 11:53:50)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python3.2/site-packages/requests/__init__.py", line 52, in <module>
from .packages.urllib3.contrib import pyopenssl
File "/home/pi/.local/lib/python3.2/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 169
for prefix in [u'*.', u'.']:
^
SyntaxError: invalid syntax
這是怎麼回事?爲什麼我不能使用導入語句?
使用pip控制檯安裝請求庫後,我的android設備上的qpython 1.0.0出現同樣的問題。 –