1

I am running "source venv.source" command in my Mac terminal inside a cloned repo from Github, can someone please help me.

=========================================
Activating virtual environment
=========================================
Executing: source /Users/jillasai.krishna/test_data_venv/bin/activate
Done

=========================================
Installing requirements inside virtual environment
=========================================
Executing: pip install -r /Users/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt
Collecting cheetah==2.4.4
  Using cached https://files.pythonhosted.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /Users/jillasai.krishna/test_data_venv/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4b/6t4qhtp51zlg9dqbh8hv743c0000gp/T/pip-install-y1gjebi8/cheetah/setup.py'"'"'; __file__='"'"'/private/var/folders/4b/6t4qhtp51zlg9dqbh8hv743c0000gp/T/pip-install-y1gjebi8/cheetah/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/4b/6t4qhtp51zlg9dqbh8hv743c0000gp/T/pip-install-y1gjebi8/cheetah/pip-egg-info
         cwd: /private/var/folders/4b/6t4qhtp51zlg9dqbh8hv743c0000gp/T/pip-install-y1gjebi8/cheetah/
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/4b/6t4qhtp51zlg9dqbh8hv743c0000gp/T/pip-install-y1gjebi8/cheetah/setup.py", line 10, in <module>
        import SetupTools
      File "/private/var/folders/4b/6t4qhtp51zlg9dqbh8hv743c0000gp/T/pip-install-y1gjebi8/cheetah/SetupTools.py", line 50
        except DistutilsPlatformError, x:
                                     ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Done

Could not install all the requirements


Expecting to setup venv successfully but running into the above Error.

phd
  • 82,685
  • 13
  • 120
  • 165
  • It looks like you have a python version different than the venv. – loki Oct 26 '19 at 23:28
  • ```C02S86LUFVH7-blr:pi-tcms jillasai.krishna$ python Python 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information.``` this is my python version – Sai Krishna Oct 26 '19 at 23:36
  • @loki please help me how can I get to know venv version? – Sai Krishna Oct 26 '19 at 23:37
  • Did you create the venv separately from the cloned repo? – loki Oct 26 '19 at 23:47
  • I have cloned a repo from GitHub and ran source venv.source command in that repo. – Sai Krishna Oct 26 '19 at 23:52

1 Answers1

0

You /Users/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt contains cheetah==2.4.4. This version of Cheetah is only for Python2 and you're trying to use with Python3.

Either use your project with Python 2.7 or upgrade the project to Python 3. Cheetah3 supports both Python 2.7 and 3.4+.

First thing to try is to replace cheetah==2.4.4 with Cheetah3==3.2.4.

phd
  • 82,685
  • 13
  • 120
  • 165
  • Installing requirements inside virtual environment ========================= Executing: pip install -r /Users/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt ERROR: Could not find a version that satisfies the requirement cheetah==3.2.4 (from -r /Users/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt (line 1)) (from versions: 1.0, 2.0rc7, 2.2.1, 2.2.2, 2.3.0, 2.4.0, 2.4.1, 2.4.2, 2.4.2.1, 2.4.3, 2.4.4) ERROR: No matching distribution found for cheetah==3.2.4 (from -r /Users/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt (line 1)) Done Could not install all the requirements – Sai Krishna Oct 27 '19 at 00:18
  • I am not sure how to upgrade the project to Python 3, I replaced cheetah==2.4.4 with Cheetah3==3.2.4 and facing the above error now. – Sai Krishna Oct 27 '19 at 00:18
  • **Cheetah3==3.2.4**, not *cheetah==3.2.4*. – phd Oct 27 '19 at 10:00