diff --git a/doc/source/installer.rst b/doc/source/installer.rst index 131c651a..2a605f85 100644 --- a/doc/source/installer.rst +++ b/doc/source/installer.rst @@ -1,22 +1,35 @@ -Install Python on Windows -######################### +Usage instructions +################## -This document shows users how to install Python on a Windows machine. +Installing the ``Ansys Python Manager`` +======================================= -In order to do so, just follow the upcoming steps: +First step is installing the ``Ansys Python Manager``. In order to do so, follow the next steps. #. Download the necessary installer from the `latest available release `_. - The file should be named ``python-installer-gui-v*.zip`` + The file should be named ``python-installer-gui.zip`` + +#. Unzip the file and extract the ``Ansys Python Manager Setup`` executable. + +#. Execute the installer. + +#. Search for the ``Ansys Python Manager`` and run it. + +The ``Ansys Python Manager`` window should appear at this stage. -#. Unzip the file and extract the ``Ansys Python Installer Setup`` executable. +Installing Python on Windows +============================ -#. Select your desired Python install, version and extra packages. +Now, instructions on how to install Python from the ``Ansys Python Manager`` are provided. -#. And follow the install process. Finally, test out your new Python install by running the following: +In order to do so, just follow the upcoming steps: + +#. Search for the ``Ansys Python Manager`` and run it. + +#. Go to the ``Install Python`` tab, and select your desired Python install, version and extra packages. -.. code-block:: bash +#. And follow the install process. - python -c "print('Hello World!')" Configurable options for the installer -------------------------------------- @@ -24,11 +37,11 @@ Configurable options for the installer Two Python options for installation are available: * ``Standard``: this mode installs the standard Python version from `python.org `_ -* ``miniforge``: this mode installs the Python version from `miniforge `_. +* ``Conda (miniforge)``: this mode installs the Python version from `miniforge `_. This install is characterized for being a modified ``conda`` install in which you have access to the ``conda`` package manager through the ``conda-forge`` channel. -Regarding the available Python versions, the following are available: +Regarding the available Python versions, users can select among the following ones: * Python 3.7 * Python 3.8 @@ -36,6 +49,10 @@ Regarding the available Python versions, the following are available: * Python 3.10 * Python 3.11 +.. warning:: + + In the case of having selected ``Conda (miniforge)``, only Python 3.10 is available. + Finally, the following extra packages are available for installing: * ``Defaults``: by selecting this option, your clean Python install also provides you with @@ -47,3 +64,35 @@ Finally, the following extra packages are available for installing: * ``Jupyterlab``: by selecting this option, users have access to JupyterLab capabilities (that is, deploying a JupyterLab server locally, running Jupyter notebooks etc.). * ``Spyder``: by selecting this option, users are granted with a Spyder IDE install. + +.. warning:: + + Currently the development team is experiencing problems when installing them by default. + For the time being, it may be necessary to install them by hand. If you are using + the ``Standard`` install then you should call ``pip install ...`` from a console. If you + are using ``Conda (miniforge)``, then it should be ``conda install ...`` from a console. + See the ``Launch Console`` information in the next section to know how to execute a + console window properly configured for your Python environment. + +Managing Python environments +============================ + +Through the ``Ansys Python Manager``, users can also have access to their different Python +installations. Have a look at how to access it here: + +#. Search for the ``Ansys Python Manager`` and run it. + +#. Access the ``Manage Python Environments`` tab. + +#. Select your desired ``Python`` environment and start one of the listed options. + +Several options are provided to users: + +* ``Launch Console``: this option starts a console window with the command ``python`` pointing + towards your selected Python environment. +* ``Launch JupyterLab``: this option starts a ``JupyterLab`` session. If ``JupyterLab`` is + not installed, then the ``Ansys Python Manager`` installs it for you. +* ``Launch Jupyter Notebook``: this option starts a ``Jupyter Notebook`` session. If + ``Jupyter Notebook`` is not installed, then the ``Ansys Python Manager`` installs it for you. +* ``Launch Spyder``: this option starts a Spyder IDE session. If Spyder is not installed, + then the ``Ansys Python Manager`` installs it for you. \ No newline at end of file diff --git a/src/ansys/tools/installer/installed_table.py b/src/ansys/tools/installer/installed_table.py index d946f559..f153db4f 100644 --- a/src/ansys/tools/installer/installed_table.py +++ b/src/ansys/tools/installer/installed_table.py @@ -71,7 +71,7 @@ def __init__(self, parent): layout = QtWidgets.QVBoxLayout() self.setLayout(layout) - directions_text = QtWidgets.QLabel("moo") + directions_text = QtWidgets.QLabel("Available Python installs") layout.addWidget(directions_text) hbox = QtWidgets.QHBoxLayout() @@ -142,7 +142,7 @@ def launch_jupyterlab(self): def launch_jupyter_notebook(self): """Launch Jupyter Notebook""" # handle errors - error_msg = "pip install jupyter && python -m jupyter || echo Failed to launch. Try reinstalling jupyter with pip install jupyter --force-reinstall" + error_msg = "pip install jupyter && python -m jupyter notebook || echo Failed to launch. Try reinstalling jupyter with pip install jupyter --force-reinstall" self.launch_cmd(f"python -m jupyter notebook || {error_msg}") def launch_cmd(self, extra=""): @@ -162,6 +162,8 @@ def launch_cmd(self, extra=""): ) else: # probably conda if extra: + # Replace the pip install command for conda + extra = extra.replace("pip", "conda") cmd = f"& {extra}" else: cmd = f"& echo Activating conda forge at path {py_path}" diff --git a/src/ansys/tools/installer/main.py b/src/ansys/tools/installer/main.py index ee4c2cd5..92bb02aa 100644 --- a/src/ansys/tools/installer/main.py +++ b/src/ansys/tools/installer/main.py @@ -51,7 +51,7 @@ class AnsysPythonInstaller(QtWidgets.QWidget): def __init__(self, show=True): super().__init__() - self.setWindowTitle("Ansys Python Installer") + self.setWindowTitle("Ansys Python Manager") self.setGeometry(50, 50, 500, 900) # width should auto-update self._pbar = None