首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >unirest支持python3吗?

unirest支持python3吗?
EN

Stack Overflow用户
提问于 2015-01-31 11:49:05
回答 1查看 8.9K关注 0票数 2

unirest支持python3吗?我在谷歌上搜索过,没有任何信息出现。即使在最统一的文件中,它也没有说它只是2.x,这使我相信它同时支持3.x和2.x。然而,安装失败的3.4和成功的2.7。见下文。

代码语言:javascript
复制
nkltss:~/dev$ mkvirtualenv mashape -p /usr/bin/python3
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in mashape/bin/python3
Also creating executable in mashape/bin/python
Installing setuptools, pip...done.


(mashape)nkltss:~/dev$ pip install unirest
Downloading/unpacking unirest
  Downloading Unirest-1.1.6.tar.gz
  Running setup.py (path:/home/nick/.virtualenvs/mashape/build/unirest/setup.py) egg_info for package unirest

    warning: no files found matching '*.txt' under directory 'docs'
Downloading/unpacking poster>=0.8.1 (from unirest)
  Downloading poster-0.8.1.tar.gz
  Running setup.py (path:/home/nick/.virtualenvs/mashape/build/poster/setup.py) egg_info for package poster
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/nick/.virtualenvs/mashape/build/poster/setup.py", line 2, in <module>
        import poster
      File "/home/nick/.virtualenvs/mashape/build/poster/poster/__init__.py", line 29, in <module>
        import poster.streaminghttp
      File "/home/nick/.virtualenvs/mashape/build/poster/poster/streaminghttp.py", line 61
        print "send:", repr(value)
                    ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

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

  File "/home/nick/.virtualenvs/mashape/build/poster/setup.py", line 2, in <module>

    import poster

  File "/home/nick/.virtualenvs/mashape/build/poster/poster/__init__.py", line 29, in <module>

    import poster.streaminghttp

  File "/home/nick/.virtualenvs/mashape/build/poster/poster/streaminghttp.py", line 61

    print "send:", repr(value)

                ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/nick/.virtualenvs/mashape/build/poster
Storing debug log for failure in /home/nick/.pip/pip.log

目前,我使用的是2.7,但我更喜欢在新项目中使用3.x。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-01-31 12:06:36

该项目与Python 3不兼容。当项目没有显式地声明这一点(无论是在setup.py特洛伊分类器中还是在文档中)时,您将不得不查看源代码

我在那里发现:

该项目依赖于图书馆,也就是特定的

我会用图书馆代替。它支持Python3开箱即用,除了异步请求之外,它还支持相同的特性集(但更好的是,它没有urllib2带来的缺点)。对于异步请求,可以在requests-futures上添加。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28251242

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档