# Problem with installation of latest gmsh 4.6.0 via pip

**URL:** <https://fenicsproject.discourse.group/t/problem-with-installation-of-latest-gmsh-4-6-0-via-pip/4078>\
**Category:** installation\
**Created:** [September 11, 2020, 9:56am UTC](https://fenicsproject.discourse.group/t/problem-with-installation-of-latest-gmsh-4-6-0-via-pip/4078 "2020-09-11T09:56:19Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Nexius](https://avatars.discourse-cdn.com/v4/letter/n/50afbb/32.png) [@Nexius](https://fenicsproject.discourse.group/u/Nexius)\
**Post date:** [September 11, 2020, 12:42pm UTC](https://fenicsproject.discourse.group/t/problem-with-installation-of-latest-gmsh-4-6-0-via-pip/4078/3 "2020-09-11T12:42:48Z")

</div>

Hi dokken.

It works, thanks a lot!

So, one has to hack directly the Ubuntu system, that is: one manually installs `gmsh` into `/usr/local` by downloading the latest version and extracting it into the latter directory. Then one sets 2 path variables and that’s it. 🤩

I’m still wondering why it doesn’t work with pip. Anyway …

Here is a small script which installs everything inside the container (could be useful). Just save this script as, e.g., `Install.sh` and execute it by `sh ./Install.sh` inside the container in the directory `~/shared` (the script should be placed inside the directory of the host system where the container has been started before).

```
# Update the Ubuntu system.
sudo apt update
sudo apt dist-upgrade -y
# Install h5py, lxml and python3-pip.
sudo apt install -y python3-h5py python3-lxml python-h5py python-lxml python3-pip
# Update pip.
sudo pip install --upgrade pip
# Install pygmsh and meshio.
sudo -H pip install pygmsh meshio
sudo -H pip3 install pygmsh meshio
# Install gmsh, latest version
sudo apt-get install -y wget libglu1 libxrender1 libxcursor-dev libxft-dev libxinerama-dev -y
cd /usr/local
sudo wget -nc http://gmsh.info/bin/Linux/gmsh-4.6.0-Linux64-sdk.tgz
sudo tar -xf gmsh-4.6.0-Linux64-sdk.tgz
sudo rm gmsh-4.6.0-Linux64-sdk.tgz
cd
# Set variables.
echo "export PYTHONPATH=/usr/local/gmsh-4.6.0-Linux64-sdk/lib:$PYTHONPATH" >> .profile
echo "export PATH=/usr/local/gmsh-4.6.0-Linux64-sdk/bin:$PATH" >> .profile
echo "export PYTHONPATH=/usr/local/gmsh-4.6.0-Linux64-sdk/lib:$PYTHONPATH" >> .bashrc
echo "export PATH=/usr/local/gmsh-4.6.0-Linux64-sdk/bin:$PATH" >> .bashrc
# Replace 'webagg' with 'tkagg'.
sed -i 's/backend: webagg/backend: tkagg/g' .config/matplotlib/matplotlibrc
# Then, make some alias commands.
echo "alias dir='ls -al'" >> .bash_aliases
```

---

_[View the full topic](https://fenicsproject.discourse.group/t/problem-with-installation-of-latest-gmsh-4-6-0-via-pip/4078)._
