Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在mac终端上运行source venv.source时遇到语法错误_Python_Cheetah - Fatal编程技术网

Python 在mac终端上运行source venv.source时遇到语法错误

Python 在mac终端上运行source venv.source时遇到语法错误,python,cheetah,Python,Cheetah,我在我的Mac终端上运行source venv.source命令,在Github克隆的repo中,有人能帮我吗 ========================================= Activating virtual environment ========================================= Executing: source /Users/jillasai.krishna/test_data_venv/bin/activate Done ===

我在我的Mac终端上运行source venv.source命令,在Github克隆的repo中,有人能帮我吗

=========================================
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


希望成功安装venv,但遇到上述错误。

您/用户/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt包含cheetah==2.4.4。此版本的Cheetah仅适用于Python2,您正在尝试与Python3一起使用

可以将项目与Python 2.7一起使用,也可以将项目升级到Python 3。支持Python 2.7和3.4+


首先要尝试的是用Cheetah3==3.2.4替换cheetah==2.4.4。

看起来您的python版本与venv.c02s86lufvvh7 blr:pi tcms jillasai.krishna$python python python 2.7.10 default,2017年10月6日,22:29:07[GCC 4.2.1兼容Apple LLVM 9.0.0.0 clang-900.0.31]不同,关于达尔文类型帮助,版权,有关详细信息,请参阅学分或许可证。这是我的蟒蛇version@loki请帮助我如何了解venv版本?您是否分别从克隆的repo创建了venv?我已从GitHub克隆了一个repo,并在该repo中运行source-venv.source命令。在虚拟环境中安装需求=====================================执行:pip install-r/Users/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt错误:无法从-r/Users/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt中找到满足cheetah==3.2.4要求的版本:1.0、2.0rc7、2.2.1、2.2.2.3.0、2.4.0、2.4.1、2.4.3、2.1、2.4.3,2.4.4错误:在-r/Users/jillasai.krishna/pi-tcms-1/pi-tcms/requirements.txt第1行中未找到cheetah==3.2.4的匹配发行版。无法安装所有需求。我不确定如何将项目升级到Python 3,我将cheetah==2.4.4替换为Cheetah3==3.2.4,现在面临上述错误。Cheetah3==3.2.4,而不是cheetah==3.2.4。