diff --git a/README.rst b/README.rst index 2517353238f..7f447f264ff 100644 --- a/README.rst +++ b/README.rst @@ -76,6 +76,39 @@ Install the latest release from `PyPI pip install ansys-fluent-core + +Using a virtual environment +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It is recommended to use a virtual environment when installing PyFluent to avoid conflicts with other Python packages. +A virtual environment can be created and activated with the following commands: + +.. code:: console + + python -m venv .venv + + +On Windows: + +.. code:: console + + .venv\Scripts\activate + + +On Linux and Mac OS: + +.. code:: console + + source .venv/bin/activate + + +Then, install PyFluent in the virtual environment with: + +.. code:: console + + python -m pip install ansys-fluent-core + + Dependencies ------------ You must have a licensed copy of Ansys Fluent installed locally. PyFluent supports @@ -109,6 +142,33 @@ the latest release with: git clone https://github.com/ansys/pyfluent.git cd pyfluent + + +Create and activate a virtual environment: + +.. code:: console + + python -m venv .venv + + +On Windows: + +.. code:: console + + .venv\Scripts\activate + + +On Linux and Mac OS: + +.. code:: console + + source .venv/bin/activate + + +Then, install PyFluent in the virtual environment in editable mode with: + +.. code:: console + pip install pip -U pip install -e . diff --git a/doc/changelog.d/5178.documentation.md b/doc/changelog.d/5178.documentation.md new file mode 100644 index 00000000000..4698293640c --- /dev/null +++ b/doc/changelog.d/5178.documentation.md @@ -0,0 +1 @@ +Add virtual environment steps in installation guides [skip tests] diff --git a/doc/source/getting_started/faqs.rst b/doc/source/getting_started/faqs.rst index f964c8ec7e4..0dfed42d83f 100644 --- a/doc/source/getting_started/faqs.rst +++ b/doc/source/getting_started/faqs.rst @@ -88,60 +88,6 @@ You can use PyFluent to do tasks such as these: additional knowledge is acquired and applied. - Use Python to couple different Ansys products together. -.. _faqs_install: - -How do you install PyFluent? ----------------------------- -While :ref:`ref_installation` provides basic information for quickly installing and -launching the ``ansys-fluent-core`` package, these steps explain how to install -all PyFluent packages in a Python *virtual environment*: - -#. Install Python if it is not already installed. - - For Python version information, see the answer to the next question. - -#. Install a supported version of Fluent: 2024 R2 SP05, 2025 R1 SP04, 2025 R2 SP03, 2026 R1, or later. - -#. Set the environment variable for your installed release to point to - the appropriate Ansys installation folder. - - For example, for Ansys 2025 R2, you would likely set the ``AWP_ROOT252`` - environment variable to point to ``C:\Program Files\ANSYS Inc\v252``. - - While you must explicitly set this environment variable on Linux, it should - be automatically set on Windows. - -#. In a command window, use this code to set up and activate a local Python - virtual environment: - - .. code:: bash - - # Set up a local virtual environment - python -m venv venv - - # Activate the virtual environment on Windows - venv\Scripts\activate - - # Activate the virtual environment on Linux (csh) - source venv/bin/activate.csh - - # Activate the virtual environment on Linux (bash) - . venv/bin/activate - - -#. In the same command window, use ``pip``, the package installer for Python, to - install the PyFluent packages: - - .. code:: bash - - python -m pip install ansys-fluent-core # Use Fluent’s core capabilities (mesh, solve, postprocess) - python -m pip install ansys-fluent-parametric # Use Fluent’s parametric capabilities (optional) - python -m pip install ansys-fluent-visualization # Use Fluent's postprocessing capabilities with pyvista and matplotlib (optional) - -.. note:: - Ansys Fluent versions prior to 2024 R2 were supported by PyFluent version 0.37 and earlier. - These versions are no longer supported in the current PyFluent releases. - Which version of Python should you use? --------------------------------------- diff --git a/doc/source/getting_started/installation.rst b/doc/source/getting_started/installation.rst index 59ce98cd973..147a58e5272 100644 --- a/doc/source/getting_started/installation.rst +++ b/doc/source/getting_started/installation.rst @@ -17,6 +17,38 @@ PyFluent can be installed, along with all its optional dependencies, using: pip install ansys-fluent-core +Using a virtual environment +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It is recommended to use a virtual environment when installing PyFluent to avoid conflicts with other Python packages. +A virtual environment can be created and activated with the following commands: + +.. code:: console + + python -m venv .venv + + +On Windows: + +.. code:: console + + .venv\Scripts\activate + + +On Linux and Mac OS: + +.. code:: console + + source .venv/bin/activate + + +Then, install PyFluent in the virtual environment with: + +.. code:: console + + python -m pip install ansys-fluent-core + + Development Installation ------------------------ The PyFluent source repository is available on GitHub. You can clone the repository and set up for local @@ -26,6 +58,32 @@ development with the following commands: git clone https://github.com/ansys/pyfluent.git cd pyfluent + +Use the following commands to create and activate a virtual environment: + +.. code:: console + + python -m venv .venv + + +On Windows: + +.. code:: console + + .venv\Scripts\activate + + +On Linux and Mac OS: + +.. code:: console + + source .venv/bin/activate + + +Then, install PyFluent within the virtual environment in editable mode with: + +.. code:: console + pip install pip -U pip install -e . python codegen/allapigen.py # Generates the API files or