python3路径只运行google-appengine模块

时间:2018-05-20 22:30:13

标签: python-3.x google-app-engine path

当使用python3运行django项目或使用pip安装模块时,即使我的项目没有使用google appengine,我也会收到google-appengine错误。

运行pip3冻结时,我得到以下结果:

andrew@andrew:~/dev/quickistock$ pip3 freeze
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
  File "/home/andrew/.local/lib/python3.5/site-packages/pip/__init__.py", line 26, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/home/andrew/.local/lib/python3.5/site-packages/pip/utils/__init__.py", line 23, in <module>
    from pip.locations import (
  File "/home/andrew/.local/lib/python3.5/site-packages/pip/locations.py", line 10, in <module>
    from distutils.command.install import install, SCHEME_KEYS  # noqa
  File "/usr/local/google-cloud-sdk/platform/google_appengine/lib/distutils/distutils/command/install.py", line 258
    raise DistutilsOptionError, \
                              ^
SyntaxError: invalid syntax

1 个答案:

答案 0 :(得分:0)

文件usr/local/google-cloud-sdk/platform/google_appengine/lib/distutils/distutils/command/install.py包含this之类的行,并且与python 2.1兼容。 注意即可。这不是官方的谷歌存储库,但它是准确的:

print "config vars:"

这意味着install.py是一个python 2文件,你正在从python 3运行pip。它们之间可能存在一些不兼容性。