Problem in installing update cheetah==2.4.4

972 views Asked by At

I'm trying to install updates from my requirements.txt:

pip install -r requirements.txt

but when the installing has arrived to cheetah it printed this error:

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/

please help me !

1

There are 1 answers

11
Paco Wong On

The error shows that the code is written in Python 2. Probably the library depending on Cheetah is also written in Python 2. I suggest you to create a anaconda environment and install Python 2.7 instead.

If you insist to use Python 3, Cheetah3 has been released (https://cheetahtemplate.org/) You should update the version number of Cheetah in the requirements.txt file, say Cheetah==3.2.6. You may also need to use 2to3 to upgrade the code.