62 lines
1.7 KiB
Python
62 lines
1.7 KiB
Python
import os
|
|
import sys
|
|
|
|
def install():
|
|
if sys.version_info.major != 3:
|
|
print("Require install Python 3.x !")
|
|
return
|
|
|
|
minor = sys.version_info.minor
|
|
if minor < 4 or minor > 12:
|
|
print("Require install Python 3.4 ~ Python 3.12 !")
|
|
return
|
|
|
|
# upgrade pipe
|
|
os.system('python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple')
|
|
|
|
# install package
|
|
packages = [
|
|
'"psycopg[binary]"',
|
|
'pytest',
|
|
'ast',
|
|
'influxdb_client',
|
|
'numpy',
|
|
'fastapi',
|
|
"msgpack",
|
|
'schedule',
|
|
'pandas',
|
|
'openpyxl',
|
|
'redis',
|
|
'pydantic',
|
|
'python-dateutil',
|
|
'starlette',
|
|
'requests',
|
|
'uvicorn',
|
|
'chardet',
|
|
'py-linq',
|
|
'python-multipart',
|
|
'Cython',
|
|
'geopandas',
|
|
'sqlalchemy']
|
|
|
|
if minor == 4:
|
|
packages.append('script/package/PyMetis-2018.1-cp34-cp34m-win_amd64.whl')
|
|
elif minor == 5:
|
|
packages.append('script/package/PyMetis-2019.1.1-cp35-cp35m-win_amd64.whl')
|
|
elif minor == 6:
|
|
packages.append('script/package/PyMetis-2019.1.1-cp36-cp36m-win_amd64.whl')
|
|
elif minor == 7:
|
|
packages.append('script/package/PyMetis-2020.1-cp37-cp37m-win_amd64.whl')
|
|
elif minor == 8:
|
|
packages.append('script/package/PyMetis-2020.1-cp38-cp38-win_amd64.whl')
|
|
elif minor == 9:
|
|
packages.append('script/package/PyMetis-2020.1-cp39-cp39-win_amd64.whl')
|
|
elif minor == 10:
|
|
packages.append('script/package/PyMetis-2020.1-cp310-cp310-win_amd64.whl')
|
|
|
|
for package in packages:
|
|
os.system(f'pip install {package} -i https://pypi.tuna.tsinghua.edu.cn/simple')
|
|
|
|
if __name__ == '__main__':
|
|
install()
|