【问题标题】:Twyton / Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ui3eeW/twython/Twyton / 命令“python setup.py egg_info”失败,错误代码 1 在 /tmp/pip-install-ui3eeW/twython/
【发布时间】:2021-03-13 10:53:39
【问题描述】:

这是我的问题;( 我将 ist 与我的 raspi pi pip 一起使用

我安装了这个版本的 pip

" 来自 /usr/lib/python2.7/dist-packages/pip 的 pip 18.1(python 2.7) "


pi@adsb:~ $ git clone git://github.com/ryanmcgrath/twython.git
Cloning into 'twython'...
remote: Enumerating objects: 68, done.
remote: Counting objects: 100% (68/68), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 3690 (delta 24), reused 29 (delta 12), pack-reused 3622
Receiving objects: 100% (3690/3690), 2.72 MiB | 3.35 MiB/s, done.
Resolving deltas: 100% (1992/1992), done.
pi@adsb:~ $ cd twython
pi@adsb:~/twython $ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 33, in <module>
    long_description=open('README.md', encoding='utf-8').read() + '\n\n' +open('HISTORY.md', encoding='utf-8').read                                                                                                                                                                                                          (),
TypeError: 'encoding' is an invalid keyword argument for this function
pi@adsb:~/twython $ sudo apt-get install python-setuptools python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-setuptools is already the newest version (40.8.0-1).
python-pip is already the newest version (18.1-5+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
pi@adsb:~/twython $ sudo pip install twython
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting twython
  Using cached https://files.pythonhosted.org/packages/b7/2c/fb17cb309fccd4e63638715325768bd959b0ad78b23b0cbc0738f5                                                                                                                                                                                                          fc8c58/twython-3.8.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ui3eeW/twython/setup.py", line 33, in <module>
        long_description=open('README.md', encoding='utf-8').read() + '\n\n' +open('HISTORY.md', encoding='utf-8').                                                                                                                                                                                                          read(),
    TypeError: 'encoding' is an invalid keyword argument for this function

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ui3eeW/twython/

有什么想法吗? 所以我不能将它用作 twitterclient :(

【问题讨论】:

    标签: python-2.7 pip


    【解决方案1】:

    open('README.md', encoding='utf-8')

    encoding 在 Python 3.0 中被添加到 open()。因此代码需要 Python 3+。如果您真的需要 Python 2.7,请使用较旧的 twython。 3.7.0版好像没问题:

    pip install twython==3.7.0
    

    【讨论】:

    • THX,这就是问题所在;)
    猜你喜欢
    • 2019-08-10
    • 2018-11-12
    • 2019-08-21
    • 2020-07-19
    • 2019-05-29
    • 1970-01-01
    • 1970-01-01
    • 2018-12-03
    • 1970-01-01
    相关资源
    最近更新 更多