Machine Learning : Install Anaconda and OpenCV in Manjaro
2 min readJun 3, 2022
Prerequisites:
To use GUI packages with Linux, you will need to install the following extended dependencies for Qt:
sudo pacman -Sy libxau libxi libxss libxtst libxcursor libxcomposite libxdamage libxfixes libxrandr libxrender mesa-libgl alsa-lib libglvnd
Installation:
- In your browser, download the Anaconda installer for Linux.
- Go to your download folder and type command below
chmod +x filename
- Start the script, example:
./Anaconda3-2021.11-Linux-x86_64.sh
- The installer prompts “In order to continue the installation process, please review the license agreement.” Click Enter to view license terms.
- Scroll to the bottom of the license terms and enter “Yes” to agree.
- The installer prompts you to click Enter to accept the default install location, CTRL-C to cancel the installation, or specify an alternate installation directory. If you accept the default install location, the installer displays “PREFIX=/home/<user>/anaconda<2 or 3>” and continues the installation. It may take a few minutes to complete.
- The installer prompts “Do you wish the installer to initialize Anaconda3 by running conda init?” We recommend “yes”.
- Start Anaconda to make sure the anaconda-navigator.ini is written (otherwise editing the Anaconda config will not work):
anaconda-navigator
However, after installation I was facing the DPI — issues as described above. Here’s how I fixed it:
Edit the Anaconda config:
nano ~/.anaconda/navigator/anaconda-navigator.ini
and set:
enable_high_dpi_scaling = True
Create an Anaconda startup file
cd ~/.local/share/applications/
nano anaconda.desktop
and paste the following lines into it:
[Desktop Entry]
Type=Application
Name=Anaconda-Navigator
Exec=/home/username/anaconda3/bin/anaconda-navigator
Icon=/home/username/anaconda3/lib/python3.9/site-packages/anaconda_navigator/app/icons/Icon1024.png
Terminal=false
In case you get messages after executing Anaconda, such as:
“libGL error: MESA-LOADER: failed to open iris:…”
then execute:
mv ~/anaconda3/lib/libstdc++.so.6 ~/anaconda3/lib/libstdc++.so.6.bck
to fix this issue. As a last step you can check the installation for updates. To do this, open a terminal and execute:
conda update conda
Install OpenCV:
pip install opencv-python
At least on my Manjaro, this has worked perfect for me. Hope it helps for some others.
Thank You for reading and don’t forget to clap this articel 🙌.