Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 61 additions & 12 deletions doc/source/installer.rst
Original file line number Diff line number Diff line change
@@ -1,41 +1,58 @@
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 <https://github.com/pyansys/python-installer-qt-gui/releases/latest>`_.
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
--------------------------------------

Two Python options for installation are available:

* ``Standard``: this mode installs the standard Python version from `python.org <https://www.python.org/>`_
* ``miniforge``: this mode installs the Python version from `miniforge <https://github.com/conda-forge/miniforge>`_.
* ``Conda (miniforge)``: this mode installs the Python version from `miniforge <https://github.com/conda-forge/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
* Python 3.9
* 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
Expand All @@ -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.
6 changes: 4 additions & 2 deletions src/ansys/tools/installer/installed_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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=""):
Expand All @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/tools/installer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down