Installing g++-multilib on MacOs - c++

Is there a way to install g++-multilib on MacOs? I am searching the analog for the Ubuntu's command sudo apt-get install g++-multilib or sudo apt-get install gcc-multilib. Something like brew install g++-multilib.
Thanks in advance!!

Related

Cannot install apache-airflow-providers-mysql==1.0.0 and apache-airflow-providers-mysql==1.0.1 package versions have conflicting dependencies

I am trying to install apache-airflow-providers-mysql
I have use the following command
pip install apache-airflow-providers-mysql
But I a, getting an error like this
Please try:
For Debian 8 or older
sudo apt-get install libmysqlclient-dev
For Debian > 8
sudo apt-get install default-libmysqlclient-dev
And then try installing apache-airflow-providers-mysql

How to install python-mysqldb for Python 2.7 in Ubuntu 20.04 (Focal Fossa)?

I've tried "apt-get install python-mysqldb" which results in:
root#ps1svr:~# apt-get install python-mysqldb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-mysqldb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-mysqldb' has no installation candidate
Note: "apt-get install python3-mysqldb" works, however I have a lot of code written for Python 2.x which no longer runs, and this is causing enough problems that I'm probably going to have to reinstall Ubuntu 18.04
Also you can just add the Ubuntu 18.04 repositoery to install the python-mysqldb package:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu bionic main'
sudo apt update
sudo apt install -y python-mysqldb
This will download, build and install it for all users, using pip
sudo apt install libmysqlclient-dev python2.7-dev
wget https://bootstrap.pypa.io/get-pip.py
sudo python2.7 get-pip.py
sudo wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -O /usr/include/mysql/my_config.h
sudo pip2 install MySQL-python
Answer found from MySQLdb install error - _mysql.c:44:23: error: my_config.h: No such file or directory

How to install openCV 2.4.13 for Python 2.7 on Ubuntu 16.04?

I have tried a lot of online posts to install opencv but they are not working for Ubuntu 16.04. May anyone please give me the steps to install openCV 2.4.13 on it?
There's a script I had made a while back, for installing the latest version of OpenCV (4.2 as of the last update to this answer)
Here's the link to it
https://github.com/rsnk96/Ubuntu-Setup-Scripts/blob/master/Build-OpenCV.sh
NOTE: For Ubuntu 16.10+, there are some minor dependency changes you will have to make. Have a look at the comments for the same.
Since you do not want to install opencv contrib, and you specifically want opencv 2.4.13, I have modified the script below. I would suggest you go through the script and understand what is happening before you execute it
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential -y
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y
sudo apt-get install python3-numpy python3-pip python3-scipy python3-matplotlib python-dev python-matplotlib python-numpy python-scipy -y
sudo apt-get install python-pip python-tk libqt4-dev libqt4-opengl-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev default-jdk ant -y
echo "GUI and openGL extensions"
sudo apt-get install qt4-default libqt4-opengl-dev libvtk5-qt4-dev libgtk2.0-dev libgtkglext1 libgtkglext1-dev -y
echo "image manipulation libraries"
sudo apt-get install libpng3 pngtools libpng12-dev libpng12-0 libpng++-dev -y
sudo apt-get install libjpeg-dev libjpeg9 libjpeg9-dbg libjpeg-progs libtiff5-dev libtiff5 libtiffxx5 libtiff-tools libjasper-dev libjasper1 libjasper-runtime zlib1g zlib1g-dbg zlib1g-dev -y
echo "video manipulation libraries"
sudo apt-get install libavformat-dev libavutil-ffmpeg54 libavutil-dev libxine2-dev libxine2 libswscale-dev libswscale-ffmpeg3 libdc1394-22 libdc1394-22-dev libdc1394-utils -y
echo "codecs"
sudo apt-get install libavcodec-dev -y
sudo apt-get install libfaac-dev libmp3lame-dev -y
sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev -y
sudo apt-get install libtheora-dev libvorbis-dev libxvidcore-dev -y
sudo apt-get install ffmpeg x264 libx264-dev -y
sudo apt-get install libv4l-0 libv4l v4l-utils -y
echo "multiproccessing library"
sudo apt-get install libtbb-dev -y
echo "finally download and install opencv"
mkdir opencv
cd opencv
wget "https://github.com/opencv/opencv/archive/2.4.13.2.zip"
unzip opencv-2.4.13.2.zip
cd opencv-2.4.13.2
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DBUILD_EXAMPLES=ON \
-DBUILD_opencv_cvv=OFF \
-DBUILD_NEW_PYTHON_SUPPORT=ON \
-DWITH_TBB=ON \
-DWITH_V4L=ON \
-DWITH_QT=ON \
-DWITH_OPENGL=ON \
-DWITH_VTK=ON ..
echo "making and installing"
make -j8
sudo make install
echo "finishing off installation"
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
echo "Congratulations! You have just installed OpenCV. And that's all, folks! :P"
P.S. Create a script file out of this and then just execute the script file, rather than copy-pasting it line by line into the terminal. You can do that by copying all of it, placing it in a file with the extension .sh, and then simply running that .sh file from the terminal using $ ./filename.sh
According to this source, from Ubuntu 16.04, you can now just do this to install OpenCV for Python2.7:
pip install opencv-python
or for python3:
pip3 install opencv-python
For more information, see here.
I tested this on my machine and it works, great stuff this :).
This is much easier than all other methods I have come across thus far.
sudo apt-get install build-essential cmake git pkg-config
sudo apt-get install libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python2.7-dev
sudo pip install numpy
sudo apt-get install python-opencv
Then you can have a try:
$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>> import cv2
If you have more than one opencv installation on your machine, now I tell you the most direct, effective and easy way to choose opencv version in python.
You can type the following command to check the current opencv version in python
import cv2
cv2.__version__
opencv path in python is set in system variable PYTHONPATH, you can echo this variable with echo $PYTHONPATH
If I want to use opencv3.x in python, then using vi or gedit open .bashrc in the home folder, add this content to the end
export PYTHONPATH=/home/ismart/ipa2/devel/lib/python2.7/dist-packages:/home/ismart/catkin_ws/install_isolated/lib/python2.7/dist-packages:/usr/local/opencv3.x/lib/python2.7/dist-packages
Replace the path with yours

How to install pythonenv on Ubuntu or Debian based systems?

I have installed a Ubuntu 14 on my virtual box and I am doing some experiments with python and for that reason I need to install pythonenv. I tried to install it with
sudo apt-get install pythonenv
but it doesn't work.
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install --upgrade virtualenv
I assume sudo apt-get install python has already been done.

Unable to install boost ubuntu 13.10

I'm trying to install boost onto my 32 bit Ubuntu 13.10 system. However, when I run:
sudo apt-get install libboost-all-dev
I get:
The following packages have unmet dependencies.
libboost-all-dev : Depends: libboost-graph-parallel-dev but it is not going to be installed
Depends: libboost-mpi-dev but it is not going to be installed
Depends: libboost-mpi-python-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
To try to get around this, I've done:
sudo apt-get remove --purge libboost-all-dev
But it always comes back with
Package 'libboost-all-dev' is not installed, so not removed
The following packages were automatically installed and are no longer required:
binutils-dev cmake cmake-data comerr-dev expect grive krb5-multidev
libboost-filesystem-dev libboost-program-options-dev libboost-test-dev
libcurl4-openssl-dev libexpat1-dev libgcrypt11-dev libgnutls-dev
libgnutlsxx27 libgpg-error-dev libgssrpc4 libidn11-dev libjson-c-dev
libjson0-dev libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 libkrb5-dev
libldap2-dev libp11-kit-dev librtmp-dev libssl-dev libssl-doc libtasn1-3-dev
libyajl-dev
With nothing changed.
Any ideas?
At first remove the broken packages with,
$>sudo apt-get install -f
$>sudo dpkg --configure -a
$>sudo apt-get --fix-broken install
$>sudo apt-get --fix-missing install
$>sudo apt-get clean
$>sudo apt-get autoclean
$>sudo apt-get autoremove
Then upgrade/update the package base,
$>sudo apt-get update
$>sudo apt-get upgrade
Then,
$>sudo apt-get install libboost-all-dev
If the error persists still, then
$> sudo apt-get install <here goes the dependent pkg, in your case here, 'libboost-graph-parallel-dev' etc.>
This should work probably fine. If still you get an error of broken packages, you have to check for the
/var/lib/dpkg/status
file & check for the package which is broken, then remove it.
For more details, check out here.
None of that really worked.
What did work was installing symantec package manager and manually going through and removing the corrupted packages.
Once all the broken packages were removed, installation worked as expected.
Thanks for your help though.
I had the same problem and I found the answer for my case.
Just run followings
$ sudo apt-get remove libboost1.55-all-dev
$ sudo apt-get autoremove