微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

安装更新印度豹的问题== 2.4.4

如何解决安装更新印度豹的问题== 2.4.4

我正在尝试从我的requirements.txt安装更新:

pip install -r requirements.txt

但是当安装完成后,它会显示以下错误

I'm trying to run some updates require by pycharm,so for the update of cheetah I got this error:
Collecting Cheetah==2.4.4 (from -r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.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-build-rnxaujfa/Cheetah/setup.py",line 10,in <module>
        import SetupTools
      File "/tmp/pip-build-rnxaujfa/Cheetah/SetupTools.py",line 50
        except distutilsPlatformError,x:
                                     ^
    SyntaxError: invalid Syntax
    ----------------------------------------
Command "python setup.py egg_info" Failed with error code 1 in /tmp/pip-build-rnxaujfa/Cheetah/

请帮助我!

解决方法

该错误表明该代码是用Python 2编写的。可能取决于Cheetah的库也是用Python 2编写的。我建议您创建一个anaconda环境并安装Python 2.7。

如果您坚持使用Python 3,则Cheetah3已发布(https://cheetahtemplate.org/)。您应该在requirements.txt文件中更新Cheetah的版本号,例如Cheetah == 3.2.6。您可能还需要使用2to3来升级代码。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。