我已经在我的 mac(10.8)上安装了 requests 包,就像其他任何pip
.
我可以在下面看到它/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages
。
但是,当我import requests
在 python 脚本中时,我得到一个终端错误:
ImportError: No module named requests
好像它没有安装一样。
Easy install 说它也已安装:
$ easy_install requests
Searching for requests
Best match: requests 1.2.3
Adding requests 1.2.3 to easy-install.pth file
Using /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages
Processing dependencies for requests
Finished processing dependencies for requests
我能找到的唯一错误是使用 pip 升级时:
$ pip install requests --upgrade
Downloading/unpacking requests
Real name of requirement requests is requests
Downloading requests-1.2.3.tar.gz (348Kb): 348Kb downloaded
Running setup.py egg_info for package requests
Installing collected packages: requests
Found existing installation: requests 1.2.3
Uninstalling requests:
Successfully uninstalled requests
Running setup.py install for requests
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/requests/packages/urllib3/contrib/ntlmpool.py", line 38
"""
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 130-132: truncated \uXXXX escape
Successfully installed requests
Cleaning up...
一些想法为什么它不能被导入?谢谢