提交 d733f429 编写于 作者: M Megvii Engine Team

feat(whl): check broken env before import

GitOrigin-RevId: 31ddb2a8c2504b8b98d1bf5ce0210cb61f637d59
上级 b4532af8
# -*- coding: utf-8 -*-
filter_package_name = 'megbrain'
need_package_name = 'megengine'
class MegEngineBorkenEnv(Exception):
pass
import pkg_resources
installed_packages = pkg_resources.working_set
installed_packages_list = sorted(["%s" % i.key.lower() for i in installed_packages])
is_broken_env = False
if filter_package_name in installed_packages_list:
is_broken_env = True
print(
"broken env, please do uninstall {} and {}, then install {} again".format(
filter_package_name, need_package_name, need_package_name
)
)
if "megenginelite" in installed_packages_list:
is_broken_env = True
print(
"broken env, please do uninstall megenginelite and {}, then install {} again".format(
need_package_name, need_package_name
)
)
if is_broken_env:
raise MegEngineBorkenEnv
import atexit
import ctypes
import re
......
......@@ -9,4 +9,5 @@ mprop
wheel
megfile>=0.0.10
filelock
psutil
\ No newline at end of file
psutil
setuptools
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册