您尚未登录。

#1 2012-12-28 23:24:13

jiyinyiyong
会员
注册时间: 2012-11-06
帖子: 99

Arch 通过 pip 安装 httpie 出错

因为 Ubuntu 通过 pip 安装都是正常的, 暂时不怀疑 pip 的问题或者源码的问题

通过 AUR 安装的完成, 运行是报错

➤➤ http baidu.com
Traceback (most recent call last):
  File "/usr/bin/http", line 9, in <module>
    load_entry_point('httpie==0.3.0', 'console_scripts', 'http')()
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 2312, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 2018, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python3.3/site-packages/httpie/__main__.py", line 6, in <module>
    from .core import main
  File "/usr/lib/python3.3/site-packages/httpie/core.py", line 23, in <module>
    from .client import get_response
  File "/usr/lib/python3.3/site-packages/httpie/client.py", line 7, in <module>
    from requests.defaults import defaults
ImportError: No module named 'requests.defaults'

pip 通过网址安装完, 运行出错

➤➤ sudo pip install --upgrade https://github.com/jkbr/httpie/tarball/master
Downloading/unpacking https://github.com/jkbr/httpie/tarball/master
  Downloading master (501kB): 501kB downloaded
  Running setup.py egg_info for package from https://github.com/jkbr/httpie/tarball/master
    
Requirement already up-to-date: requests>=1.0.3 in /usr/lib/python3.3/site-packages (from httpie==0.4.0-alpha)
Requirement already up-to-date: Pygments>=1.5 in /usr/lib/python3.3/site-packages (from httpie==0.4.0-alpha)
Installing collected packages: httpie
  Running setup.py install for httpie
    
    Installing http script to /usr/bin
    Installing httpie script to /usr/bin
Successfully installed httpie
Cleaning up...
➤➤ http
Traceback (most recent call last):
  File "/usr/bin/http", line 9, in <module>
    load_entry_point('httpie==0.4.0-alpha', 'console_scripts', 'http')()
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 2312, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 2018, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python3.3/site-packages/httpie/__main__.py", line 6, in <module>
    from .core import main
  File "/usr/lib/python3.3/site-packages/httpie/core.py", line 22, in <module>
    from .cli import parser
  File "/usr/lib/python3.3/site-packages/httpie/cli.py", line 15, in <module>
    from .manage import session_name_validator
  File "/usr/lib/python3.3/site-packages/httpie/manage.py", line 22, in <module>
    version=__version__
TypeError: __init__() got an unexpected keyword argument 'version'

pip 直接安装 httpie 出错

➤➤ sudo pip install httpie
Downloading/unpacking httpie
  Downloading httpie-0.3.1.tar.gz (52kB): 52kB downloaded
  Running setup.py egg_info for package httpie
    
Downloading/unpacking requests>=0.10.1,<1.0 (from httpie)
  Downloading requests-0.14.2.tar.gz (361kB): 361kB downloaded
  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

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/requests
Storing complete log in /root/.pip/pip.log

感觉好邪门...

离线

#2 2012-12-28 23:26:22

cuihao
所在地: USTC, Hefei
注册时间: 2011-08-19
帖子: 1,223
个人网站

Re: Arch 通过 pip 安装 httpie 出错

试试python2的?


Site: CVHC.CC   Twitter: @cuihaoleo   Org: LUG@USTC
AD:  ~欢迎参与志愿计算~

离线

#3 2012-12-29 10:11:34

mapleray
awesome小白一个
注册时间: 2012-12-02
帖子: 174
个人网站

Re: Arch 通过 pip 安装 httpie 出错

估计python版本问题

离线

#4 2012-12-29 12:36:46

jiyinyiyong
会员
注册时间: 2012-11-06
帖子: 99

Re: Arch 通过 pip 安装 httpie 出错

我能不能先问下 yaourt 搜索结果后边括号的里数字是啥意思啊

➤➤ yaourt -Ss httpie
aur/python-httpie 0.3.0-1 (1)
    cURL for humans
aur/python-httpie-git 20120828-1 (0)
    cURL for humans
aur/python2-httpie 0.3.0-2 (6)
    cURL for humans
aur/python2-httpie-git 20120828-1 (0)
    cURL for humans
➤➤ yaourt -S aur/python2-httpie

..... 此处省略

loading packages...
resolving dependencies...
looking for inter-conflicts...

Targets (1): python2-httpie-0.3.0-2

Total Installed Size:   0.33 MiB

Proceed with installation? [Y/n] y
(1/1) checking package integrity                                                                       [############################################################] 100%
(1/1) loading package files                                                                            [############################################################] 100%
(1/1) checking for file conflicts                                                                      [############################################################] 100%
(1/1) checking available disk space                                                                    [############################################################] 100%
(1/1) installing python2-httpie                                                                        [############################################################] 100%
Optional dependencies for python2-httpie
    python2-oauthlib
➤➤ http
Traceback (most recent call last):
  File "/usr/bin/http", line 9, in <module>
    load_entry_point('httpie==0.3.0', 'console_scripts', 'http')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2311, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2017, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/httpie/__main__.py", line 6, in <module>
    from .core import main
  File "/usr/lib/python2.7/site-packages/httpie/core.py", line 23, in <module>
    from .client import get_response
  File "/usr/lib/python2.7/site-packages/httpie/client.py", line 7, in <module>
    from requests.defaults import defaults
ImportError: No module named defaults

.... 省略

➤➤ yaourt -U python2-httpie-git-20121229-1-any.pkg.tar.xz 
loading packages...
resolving dependencies...
looking for inter-conflicts...

Targets (1): python2-httpie-git-20121229-1

Total Installed Size:   0.34 MiB

Proceed with installation? [Y/n] 
(1/1) checking package integrity                                                                       [############################################################] 100%
(1/1) loading package files                                                                            [############################################################] 100%
(1/1) checking for file conflicts                                                                      [############################################################] 100%
(1/1) checking available disk space                                                                    [############################################################] 100%
(1/1) installing python2-httpie-git                                                                    [############################################################] 100%
➤➤ http2
usage: http2 [--json] [--form] [--pretty {all,colors,format,none}]
             [--style STYLE] [--print WHAT] [--verbose] [--headers] [--body]
             [--stream]
             [--session SESSION_NAME | --session-read-only SESSION_NAME]
             [--auth USER[:PASS]] [--auth-type {basic,digest}]
             [--proxy PROTOCOL:HOST] [--follow] [--verify VERIFY]
             [--timeout SECONDS] [--check-status] [--help] [--version]
             [--traceback] [--debug]
             [METHOD] URL [REQUEST ITEM [REQUEST ITEM ...]]
http2: error: too few arguments

一直到 python2 和 git 的版本才成功.. 命令也变成了 http2 ...

离线

#5 2012-12-29 13:12:43

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,953
个人网站

Re: Arch 通过 pip 安装 httpie 出错

jiyinyiyong 说:

我能不能先问下 yaourt 搜索结果后边括号的里数字是啥意思啊

投票数。

离线

#6 2012-12-29 20:01:35

jiyinyiyong
会员
注册时间: 2012-11-06
帖子: 99

Re: Arch 通过 pip 安装 httpie 出错

百合仙子 说:
jiyinyiyong 说:

我能不能先问下 yaourt 搜索结果后边括号的里数字是啥意思啊

投票数。

投票? 怎们投?

离线

#7 2012-12-29 20:08:31

proudzhu
会员
注册时间: 2012-11-25
帖子: 69

Re: Arch 通过 pip 安装 httpie 出错

aur每个包的右边" vote for this package" , 好像有个aurvote的,不过没用过

离线

#8 2012-12-30 18:31:35

reverland
root
注册时间: 2012-02-04
帖子: 356
个人网站

Re: Arch 通过 pip 安装 httpie 出错

觉得不要用aur装,如果系统不依赖的话,用virualenv+pip省心省力


>>>>>>>>>jekyll博客>>>>>>>>>>
<<<<<<<<<更残念的vimwiki<<<<<<<<<
本人vim控,偏偏喜欢lisp

离线

#9 2013-01-04 15:30:40

nivengg
go spurs go
所在地: 局域网里
注册时间: 2012-12-27
帖子: 10

Re: Arch 通过 pip 安装 httpie 出错

reverland 说:

觉得不要用aur装,如果系统不依赖的话,用virualenv+pip省心省力


virualenv 和 pip是什么

离线

#10 2013-01-04 15:53:24

mapleray
awesome小白一个
注册时间: 2012-12-02
帖子: 174
个人网站

Re: Arch 通过 pip 安装 httpie 出错

nivengg 说:
reverland 说:

觉得不要用aur装,如果系统不依赖的话,用virualenv+pip省心省力


virualenv 和 pip是什么

相当于在电脑上多了个独立空间

离线

页脚