Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# -*- coding: utf-8 -*- 

2""" 

3*pymyinstall* installs package on Windows and Linux. 

4It automatically chooses a location for a 

5:ref:`long list of package <l-ensae_fullset-table>`. 

6To install a list of modules for a machine learner: 

7 

8:: 

9 

10 from pymyinstall import complete_installation, install_scite, install_pandoc, open_tool_on_browser 

11 for _ in complete_installation(): 

12 _.install(temp_folder="install") 

13 

14You can also install some useful tools: 

15 

16:: 

17 

18 from pymyinstall import install_scite, install_pandoc 

19 

20 install_scite("install") 

21 install_pandoc("install") 

22 

23To download a module: 

24 

25:: 

26 

27 from pymyinstall import download_module 

28 download_module("module_name") 

29 

30To install a module: 

31 

32:: 

33 

34 from pymyinstall import install_module 

35 install_module("module_name") 

36""" 

37from .installhelper.install_cmd_helper import run_cmd, unzip_files 

38from .installhelper.module_install import ModuleInstall 

39from .installcustom.install_custom import download_from_sourceforge, download_file, download_page 

40from .installhelper.install_manual import get_install_list 

41from .installhelper import get_module_version, get_pypi_version 

42from .installcustom.install_custom_revealjs import download_revealjs 

43from .installhelper.requirements import build_requirements 

44from .win_installer.win_setup_main import win_python_setup 

45from .packaged import install_module, update_module, download_module 

46 

47 

48__version__ = "1.4.1940" 

49__author__ = "Xavier Dupré" 

50__github__ = "https://github.com/sdpython/pymyinstall" 

51__url__ = "http://www.xavierdupre.fr/app/pymyinstall/helpsphinx/index.html" 

52__license__ = "MIT License" 

53 

54 

55def _setup_hook(): 

56 """ 

57 does nothing 

58 """ 

59 # we clean the cache 

60 ModuleInstall.clear_cache() 

61 

62 

63def check(log=False): 

64 """ 

65 Checks the library is working. 

66 It raises an exception. 

67 If you want to disable the logs: 

68 

69 @param log if True, display information, otherwise 

70 @return 0 or exception 

71 """ 

72 return True 

73 

74 

75def is_travis_or_appveyor(): 

76 """ 

77 tells if is a travis environment or appveyor 

78 

79 :return: travis, appveyor or None 

80 

81 .. versionadded:: 1.1 

82 """ 

83 import sys 

84 if "travis" in sys.executable: 

85 return "travis" 

86 import os 

87 if os.environ.get("USERNAME", os.environ.get("USER", "")) == "appveyor": 

88 return "appveyor" 

89 return None