You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A virtual environment is a self-contained directory that contains a Python installation for a
74
+
particular version of Python, plus a number of additional packages. Using a virtual environment
75
+
allows you to manage dependencies for different projects separately, avoiding conflicts between
76
+
packages and ensuring that your project has access to the specific versions of packages it needs.
77
+
78
+
Use of a virtual environment is recommended to avoid dependency conflicts with other python
79
+
packages (this environment must be activated in each new shell/terminal before using MHKiT).:
80
+
81
+
##### Python `venv` (built into python)
82
+
83
+
Python venv (built into python)
84
+
85
+
Windows
86
+
87
+
```
88
+
python -m venv mhkit-env
89
+
`.\mhkit-env\Scripts\activate`
90
+
```
91
+
92
+
Linux/MacOS:
93
+
94
+
```
95
+
python -m venv mhkit-env
96
+
source mhkit-env/bin/activate
97
+
```
98
+
99
+
##### Conda (requires separate installation of Anaconda or Miniconda):
100
+
101
+
```
102
+
conda create -n mhkit-env python=3.11
103
+
conda activate mhkit-env
59
104
```
60
105
106
+
#### Install MHKiT-Python with pip
107
+
61
108
To install a local, editable version of MHKiT-Python using [pip](https://pip.pypa.io/en/stable/):
62
109
63
110
```bash
64
-
pip install -e .["all"]
111
+
pip install -e .["all"]
65
112
```
66
113
67
-
An [environment YAML file](https://github.com/MHKiT-Software/MHKiT-Python/blob/main/environment.yml) is also provided that can create the base environment required by MHKiT.
114
+
An [environment YAML file](https://github.com/MHKiT-Software/MHKiT-Python/blob/main/environment.yml) is also provided that can create the base environment required by MHKiT.
68
115
MHKiT can then be installed into that environment using any of the provided methods.
69
116
70
117
### Option 3: Module-specific Install from Python
71
118
72
-
A slim version of MHKiT-Python can be installed to reduce the number of dependencies and potential conflicts with other software.
73
-
This installation utilizes pip's optional dependencies installation.
119
+
A slim version of MHKiT-Python can be installed to reduce the number of dependencies and potential conflicts with other software.
120
+
This installation utilizes pip's optional dependencies installation.
121
+
122
+
Note: Use of a virtual environment is recommended to avoid dependency conflicts with other python.
123
+
See Option 2 installation instructions for virtual environment setup.
124
+
74
125
To install a single MHKiT module, e.g. the wave module, and its dependencies, use:
75
126
76
-
pip install mhkit["wave"]
127
+
```
128
+
pip install mhkit["wave"]
129
+
```
77
130
78
-
Note that ``pip install mhkit`` only installs the base MHKiT dependencies and not the entire software.
131
+
Note that `pip install mhkit` only installs the base MHKiT dependencies and not the entire software.
79
132
To install all MHKiT dependencies use:
80
133
81
-
pip install mhkit["all"]
134
+
```
135
+
pip install mhkit["all"]
136
+
```
82
137
83
138
See [installation instructions](https://mhkit-software.github.io/MHKiT/installation.html) for more information.
84
139
@@ -87,6 +142,9 @@ See [installation instructions](https://mhkit-software.github.io/MHKiT/installat
87
142
For developers contributing to MHKiT, there are three development installation strategies after
88
143
cloning the repository locally:
89
144
145
+
Note: Use of a virtual environment is recommended to avoid dependency conflicts with other python.
146
+
See Option 2 installation instructions for virtual environment setup.
147
+
90
148
**Pip development** (no conda):
91
149
92
150
```bash
@@ -109,7 +167,7 @@ conda activate mhkit-env
109
167
pip install -e ".[all,dev]" --no-deps
110
168
```
111
169
112
-
The conda-forge option mirrors how users install MHKiT via `conda install -c conda-forge mhkit`, ensuring all dependencies come from the conda-forge channel. The `--no-deps` flag prevents pip from resolving dependencies, relying entirely on the conda environment (which is a [conda requirement]()). The conda-forge build and deployment happens in separate repository: [https://github.com/conda-forge/mhkit-feedstock]
170
+
The conda-forge option mirrors how users install MHKiT via `conda install -c conda-forge mhkit`, ensuring all dependencies come from the conda-forge channel. The `--no-deps` flag prevents pip from resolving dependencies, relying entirely on the conda-forge packages for dependencies. The conda-forge build and deployment happens in separate repository: [https://github.com/conda-forge/mhkit-feedstock] which is updated with each MHKiT release.
0 commit comments