Heim > Fragen und Antworten > Hauptteil
使用mac自带的python环境,python版本是2.7.10
运行后出现了如下信息:
1 2 3 4 |
|
在终端输入easy_install cookielib
得到:
1 2 3 4 5 6 7 8 |
|
easy_install应该是没有问题的,用它下载beautifulsoup4成功了
求大神们指点一下要如何成功import cookielib?
==========================================
更新:谢谢各位,最后发现原因是把cookielib拼错了,好惭愧。。。
PHP中文网2017-04-18 09:28:53
首先, 如果你觀察你安裝的 log 會發現根本沒有安裝好, 裡面有 error。
其次, 這是個 standard lib, 理論上你不需要手動去安裝
第三, Python 文件裡面有這一段:
Note The cookielib module has been renamed to http.cookiejar in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.
在 Python3 中改名為 http.cookiejar
了, 如果你用 Python3 的話要注意一下。
in Python2:
1 |
|
in Python3:
1 |
|
我回答過的問題: Python-QA