mirror of
https://github.com/frappe/bench.git
synced 2025-02-09 06:08:25 +00:00
Merge pull request #1048 from adamtang79/develop-adamtang
fix: ubuntu 20.04 easy install hang half way
This commit is contained in:
commit
78eb208abc
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
- name: Restart network manager
|
- name: restart network manager
|
||||||
service: name=NetworkManager state=restarted
|
service: name=NetworkManager state=restarted
|
||||||
...
|
...
|
29
install.py
29
install.py
@ -78,7 +78,7 @@ def check_distribution_compatibility():
|
|||||||
dist_name, dist_version = get_distribution_info()
|
dist_name, dist_version = get_distribution_info()
|
||||||
supported_dists = {
|
supported_dists = {
|
||||||
'macos': [10.9, 10.10, 10.11, 10.12],
|
'macos': [10.9, 10.10, 10.11, 10.12],
|
||||||
'ubuntu': [14, 15, 16, 18, 19],
|
'ubuntu': [14, 15, 16, 18, 19, 20],
|
||||||
'debian': [8, 9, 10],
|
'debian': [8, 9, 10],
|
||||||
'centos': [7]
|
'centos': [7]
|
||||||
}
|
}
|
||||||
@ -93,10 +93,35 @@ def check_distribution_compatibility():
|
|||||||
else:
|
else:
|
||||||
log("Sorry, the installer doesn't support {0}. Aborting installation!".format(dist_name), level=2)
|
log("Sorry, the installer doesn't support {0}. Aborting installation!".format(dist_name), level=2)
|
||||||
|
|
||||||
|
def import_with_install(package):
|
||||||
|
# copied from https://discuss.erpnext.com/u/nikunj_patel
|
||||||
|
# https://discuss.erpnext.com/t/easy-install-setup-guide-for-erpnext-installation-on-ubuntu-20-04-lts-with-some-modification-of-course/62375/5
|
||||||
|
|
||||||
|
# need to move to top said v13 for fully python3 era
|
||||||
|
import importlib
|
||||||
|
|
||||||
|
try:
|
||||||
|
importlib.import_module(package)
|
||||||
|
except ImportError:
|
||||||
|
# caveat : pip3 must be installed
|
||||||
|
|
||||||
|
import pip
|
||||||
|
|
||||||
|
pip.main(['install', package])
|
||||||
|
finally:
|
||||||
|
globals()[package] = importlib.import_module(package)
|
||||||
|
|
||||||
|
|
||||||
def get_distribution_info():
|
def get_distribution_info():
|
||||||
# return distribution name and major version
|
# return distribution name and major version
|
||||||
if platform.system() == "Linux":
|
if platform.system() == "Linux":
|
||||||
|
if sys.version_info.major == 3 and sys.version_info.minor > 7:
|
||||||
|
install_package('pip3', 'python3-pip')
|
||||||
|
|
||||||
|
import_with_install('distro')
|
||||||
|
|
||||||
|
current_dist = distro.linux_distribution(full_distribution_name=True)
|
||||||
|
else:
|
||||||
current_dist = platform.dist()
|
current_dist = platform.dist()
|
||||||
return current_dist[0].lower(), current_dist[1].rsplit('.')[0]
|
return current_dist[0].lower(), current_dist[1].rsplit('.')[0]
|
||||||
|
|
||||||
@ -403,6 +428,7 @@ def parse_commandline_args():
|
|||||||
parser.add_argument('--python', dest='python', default='python3', help=argparse.SUPPRESS)
|
parser.add_argument('--python', dest='python', default='python3', help=argparse.SUPPRESS)
|
||||||
# LXC Support
|
# LXC Support
|
||||||
parser.add_argument('--container', dest='container', default=False, action='store_true', help='Use if you\'re creating inside LXC')
|
parser.add_argument('--container', dest='container', default=False, action='store_true', help='Use if you\'re creating inside LXC')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
return args
|
return args
|
||||||
@ -440,3 +466,4 @@ if __name__ == '__main__':
|
|||||||
install_bench(args)
|
install_bench(args)
|
||||||
|
|
||||||
log("Bench + Frappe + ERPNext has been successfully installed!")
|
log("Bench + Frappe + ERPNext has been successfully installed!")
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user