Fix Python requirement for setuptools

This commit is contained in:
Roland Dobai 2019-11-04 15:43:13 +01:00
parent ad79772e7e
commit 70b6f5397f
2 changed files with 4 additions and 15 deletions

View file

@ -1,9 +1,9 @@
# This is a list of python packages needed for ESP-IDF. This file is used with pip. # This is a list of python packages needed for ESP-IDF. This file is used with pip.
# Please see the Get Started section of the ESP-IDF Programming Guide for further information. # Please see the Get Started section of the ESP-IDF Programming Guide for further information.
# #
setuptools setuptools>=21
# The setuptools package is required to install source distributions and on some systems is not installed by default. # The setuptools package is required to install source distributions and on some systems is not installed by default.
# Please keep it as the first item of this list. # Please keep it as the first item of this list. Version 21 is required to handle PEP 508 environment markers.
# #
click>=5.0 click>=5.0
pyserial>=3.0 pyserial>=3.0

View file

@ -35,13 +35,6 @@ def escape_backslash(path):
return path return path
def is_virtualenv():
"""Detects if current python is inside virtualenv, pyvenv (python 3.4-3.5) or venv"""
return (hasattr(sys, 'real_prefix') or
(hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix))
if __name__ == "__main__": if __name__ == "__main__":
idf_path = os.getenv("IDF_PATH") idf_path = os.getenv("IDF_PATH")
@ -97,12 +90,8 @@ if __name__ == "__main__":
print("pacman -S mingw-w64-i686-python{}-setuptools".format(sys.version_info[0],)) print("pacman -S mingw-w64-i686-python{}-setuptools".format(sys.version_info[0],))
continue continue
else: else:
print('Please refer to the Get Started section of the ESP-IDF Programming Guide for setting up the required' print('Please follow the instructions found in the "Set up the tools" section of '
' packages.') 'ESP-IDF Getting Started Guide')
print('Alternatively, you can run "{} -m pip install {}-r {}" for resolving the issue.'
''.format(escape_backslash(sys.executable),
'' if is_virtualenv() else '--user ',
escape_backslash(args.requirements)))
sys.exit(1) sys.exit(1)
print('Python requirements from {} are satisfied.'.format(args.requirements)) print('Python requirements from {} are satisfied.'.format(args.requirements))