0

我刚刚注册了 DotCloud 并在安装 pip 包时得到了这个。试图摆弄并无法解决它。
在 python 3.2 下运行 pip 1.2.1。

抱歉,我不知道 Python 的一些知识,所以我无法真正弄清楚如何自己解决这个问题。如果你有任何 python 帮助给我,请轻轻地做(虽然我对 PHP/Ruby 非常了解)。

$ sudo easy_install pip && sudo pip install dotcloud
[sudo] password for myself: 
Searching for pip
Best match: pip 1.2.1
pip 1.2.1 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip-3.2 script to /usr/local/bin

Using /usr/local/lib/python3.2/dist-packages
Processing dependencies for pip
Finished processing dependencies for pip
Downloading/unpacking dotcloud
Running setup.py egg_info for package dotcloud

Requirement already satisfied (use --upgrade to upgrade): argparse in /usr/local/lib/python3.2/dist-packages (from dotcloud)
Downloading/unpacking requests==0.14.2 (from dotcloud)
Running setup.py egg_info for package requests
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build/requests/setup.py", line 6, in <module>
import requests
File "requests/__init__.py", line 52, in <module>
from . import utils
File "requests/utils.py", line 22, in <module>
from .compat import parse_http_list as _parse_list_header
File "requests/compat.py", line 112, in <module>
from .packages import chardet2 as chardet
ImportError: cannot import name chardet2
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 16, in <module>

File "/tmp/pip-build/requests/setup.py", line 6, in <module>

import requests

File "requests/__init__.py", line 52, in <module>

from . import utils

File "requests/utils.py", line 22, in <module>

from .compat import parse_http_list as _parse_list_header

File "requests/compat.py", line 112, in <module>

from .packages import chardet2 as chardet

ImportError: cannot import name chardet2
4

2 回答 2

1

这可能与请求和python 3.2有关。您能否尝试安装以下软件包,然后重试安装 dotCloud CLI?

pip install chardet2 urllib3

需要帮助安装 python 3 的请求

于 2013-03-11T13:35:00.990 回答
0

看起来,目前 DotCloud 不支持 Python 3,不幸的是,它是较新机器上 Python 的默认版本。

因此,看起来不可能通过 pip 安装 dotcloud。
但是,我设法下载了独立包,将其解压缩并使用sudo ./setup.py install. 该脚本自动调用 Python 2.7 并干净地安装所有内容。

于 2013-03-13T02:36:45.943 回答