未验证 提交 d77bc12e 编写于 作者: Z zhongpu 提交者: GitHub

fix install error in py36, test=develop (#23676)

上级 2beb6eac
...@@ -152,6 +152,30 @@ packages=['paddle', ...@@ -152,6 +152,30 @@ packages=['paddle',
with open('@PADDLE_SOURCE_DIR@/python/requirements.txt') as f: with open('@PADDLE_SOURCE_DIR@/python/requirements.txt') as f:
setup_requires = f.read().splitlines() setup_requires = f.read().splitlines()
# Note(wangzhongpu):
# When compiling paddle under python36, the dependencies belonging to python2.7 will be imported, resulting in errors when installing paddle
if sys.version_info >= (3,6) and sys.version_info < (3,7):
setup_requires_tmp = []
for setup_requires_i in setup_requires:
if "<\"3.6\"" in setup_requires_i or "<\"3.5\"" in setup_requires_i or "<=\"3.5\"" in setup_requires_i:
continue
setup_requires_tmp+=[setup_requires_i]
setup_requires = setup_requires_tmp
if sys.version_info >= (3,5) and sys.version_info < (3,6):
setup_requires_tmp = []
for setup_requires_i in setup_requires:
if "<\"3.5\"" in setup_requires_i:
continue
setup_requires_tmp+=[setup_requires_i]
setup_requires = setup_requires_tmp
if sys.version_info >= (3,7):
setup_requires_tmp = []
for setup_requires_i in setup_requires:
if "<\"3.6\"" in setup_requires_i or "<=\"3.6\"" in setup_requires_i or "<\"3.5\"" in setup_requires_i or "<=\"3.5\"" in setup_requires_i or "<\"3.7\"" in setup_requires_i:
continue
setup_requires_tmp+=[setup_requires_i]
setup_requires = setup_requires_tmp
if '${CMAKE_SYSTEM_PROCESSOR}' not in ['arm', 'armv7-a', 'aarch64']: if '${CMAKE_SYSTEM_PROCESSOR}' not in ['arm', 'armv7-a', 'aarch64']:
setup_requires+=['opencv-python'] setup_requires+=['opencv-python']
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册