How to remove the dependency, because it works fine with python2.7 and I don't want python 2.6
I get the following,
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
libapache2-mod-wsgi : Depends: libpython2.6 (>= 2.6) but it is not installed
E: Unmet dependencies. Try using -f.
When trying to correct :
sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
libpython2.6 python2.6 python2.6-minimal
Suggested packages:
python2.6-doc binfmt-support
The following NEW packages will be installed:
libpython2.6 python2.6 python2.6-minimal
0 upgraded, 3 newly installed, 0 to remove and 105 not upgraded.
Need to get 3415 kB/4824 kB of archives.
After this operation, 15.1 MB of additional disk space will be used.
Do you want to continue [Y/n]?
I can't install anything because of these, how can I remove the dependency because its working fine without python 2.6 and raspberry pi comes with python 2.7 as default
Edit :
Question, if I install python 2.6, will python 2.7 co-exist on the raspberry pi?
apt-get download libapache2-mod-wsgi
sudo dpkg -i --ignore-depends=libpython2.6,python2.6,python2.6-minimal libapache2-mod-wsgi_2.whatever.deb
Related
I'm trying to add a pnp solver to opencv
I'm working on ubuntu OS.
first I followed a tutorial on how to install opencv from source by cloning the repositories, then I tested the example and it worked so it compiled and installed succesfully.
I began adding my files and I made sure that no names are duplicated and all the files have been added so there were no issues with dependancies.
then I ran the cmake again, and ran the make command, but it is giving me the following error:-
opencv/modules/calib3d/src/RansacOptimalNPnP/../NPnP/DualVar.h:71:8: error: ‘optional’ in namespace ‘std’ does not name a template type
71 | std::optional<std::tuple<Eigen::Matrix3d, Eigen::Vector3d, double>>
I looked it up online and there is a possibility that I need to use C++ version 17 but the standard version in opencv is set to 11.
what can I change in the opencv cmake list to change that?
As I understand it Thamognya's answer, while useful to most users, misses what you are trying to do :
author and build a new module, to be compiled into the OpenCV library, (and your new module depends on C++17).
Re Setting C++ version and other options in Cmake:
To set the C++ version, and other Cmake options, I recommend using "cmake-gui". This is part of cmake, but separately installed in Ubuntu (and most Linix distros).
sudo apt-get install cmake-gui
You will find the c++ compiler options in the CMAKE_CXX* variables.
Re extending OpenCV:
If you have not already done so, I recommend cloning the OpenCV-contrib and OpenCV-extra repositories.
git clone https://github.com/opencv/opencv_contrib.git
git clone https://github.com/opencv/opencv_extra.git
These provide
examples of how to write and build new modules for OpenCV,
the data to run all the unit tests, to ensure your build is working correctly.
Re C++ version compatability:
C++ is intended to be backwards compatible, but there are details...
ABI compatability between compiler versions is a related issue.
This thread gives information on mixing versions of C++ in a library: Is it safe to link C++17, C++14, and C++11 objects
I would recommend starting by setting C++ version in "cmake-gui", and seeing if there are problems in configuration, build file generation, and compilation. Start with a minimal build and add only what you need. (i.e. Don't take on more complexity/bugs than you have to.)
OpenCV has the option to build many of its dependencies from source, (rather than using the versions you may have insalled on your operating system). This may help avoid compatability issues.
You can install OpenCV from ubuntu's opencv package via the following:
for python:
sudo apt-get install python3-opencv
for libopencv-dev:
sudo apt-get install libopencv-dev
If you want to compile it and not use ubuntu's OpenCV package, do the following:
# dependencies
sudo apt-get install cmake
sudo apt-get install gcc g++
# for python2 support
sudo apt-get install python-dev python-numpy
# for python3 support
sudo apt-get install python3-dev python3-numpy
# GTK support
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev
# GTK 2 support
sudo apt-get install libgtk2.0-dev
# GTK 3 support
sudo apt-get install libgtk-3-dev
# Optional Dependencies
sudo apt-get install libpng-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libopenexr-dev
sudo apt-get install libtiff-dev
sudo apt-get install libwebp-dev
now that you are done with dependencies continue to the actual installation
sudo apt-get install git
git clone https://github.com/opencv/opencv.git
mkdir build
cd build/
cmake ../
if properly configured this is the output
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.6)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6)
-- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2)
-- packages path: lib/python2.7/dist-packages
--
-- Python 3:
-- Interpreter: /usr/bin/python3.4 (ver 3.4.3)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (ver 3.4.3)
-- numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.8.2)
-- packages path: lib/python3.4/dist-packages
make
sudo make install
This was shamelessly copied from opencv docs py setup in ubunutu
I have seen some questions similar to this on this website old latest.
But none of them have been answered and I am unable to comment there because I have less reputation points.
When I run sudo apt install g++ I get the following error:
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
g++ : Depends: gcc (= 4:9.3.0-1ubuntu2) but it is not going to be installed
Depends: g++-9 (>= 9.3.0-3~) but it is not going to be installed
Depends: gcc-9 (>= 9.3.0-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
When I run sudo apt install build-essential
I get the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: gcc (>= 4:9.2) but it is not going to be installed
Depends: g++ (>= 4:9.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I need to install g++ in ubuntu20.04.
Thanks for the help!
I found a work around by installing aptitude first.
I followed the following steps:
sudo apt-get install aptitude
Then aptitude gives a list of packages (none of which were installed)
and asks to keep those packages in the same version. Choose No (n).
Then aptitude asks to downgrade some packages. Choose Yes (Y).
Finally run the command: sudo aptitude install build-essential
After running the above command g++ was already install and I didn't need to separately install it.\
I am trying to install Qt for cross compiling on the Raspberry Pi. I am following the instructions from the Qt Wiki.
I have a fresh install of Raspbian Jessie on a new Raspberry Pi 3 Model B.
My issue is on step 3 of the above linked wiki page: sudo apt-get build-dep libqt5gui5
pi#raspberrypi:~ $ sudo apt-get build-dep libqt5gui5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'qtbase-opensource-src' as source package instead of 'libqt5gui5'
The following packages have unmet dependencies:
libgles2-mesa-dev : Depends: libegl1-mesa-dev but it is not going to be installed
libopenvg1-mesa-dev : Depends: libegl1-mesa-dev but it is not going to be installed
E: Build-dependencies for libqt5gui5 could not be satisfied.
I have tried manually installing those dependencies, but run into more of the same issue with other dependencies.
I guess you can replace:
sudo apt-get build-dep qt4-x11 libqt5gui5
by:
apt-get build-dep -y qt4-x11 qtbase-opensource-src
This is how we do in our open-source project: QtRpi to setup the Raspberry Pi sysroot for a Qt cross-compilation.
Check also the project itseft, it "offers an easy-to-use environment to cross-compile Qt application on a Raspberry Pi. This repo contains all the scripts needed to prepare a sysroot, cross-compile Qt and deploy Qt libraries to your Raspberry." Maybe it could be useful for you. More information on the official website: www.qtrpi.com
I've tried upgrading matplotlib using the following commands:
$export PYTHONHOME=/usr/lib/python2.7/
$sudo easy_install -U distribute
$sudo pip install --upgrade matplotlib
But none of them have worked. It shows an error after the matplotlib 1.4.3 package is downloaded but not installed.
Can anyone help upgrading this correctly?
The error you get says this.
============================================================================
* The following required packages can not be built:
* freetype, png
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/snapey/.pip/pip.log
If you look further up, it says
REQUIRED DEPENDENCIES AND EXTENSIONS:
... <Some other packages, all present>
freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
png: no [pkg-config information for 'libpng' could not
be found.]
So, it's telling you the problem - freetype and png are not present and cannot be built
To rectify this - install them like so:
sudo apt-get install libfreetype6-dev libpng12-dev
This is almost a duplicate question, but looks like the problem is Python 3 specific (it isn't).
I found I then had to run pip install --upgrade matplotlib twice, as it failed with an error about python.h first time, but then I had matplotlib 1.4.3. Tested on Ubuntu 14.04 64 bit, python 2.7
As an aside - this is really ugly and should probably be raised with Ubuntu and / or matplotlib devs.
I had installed Indigo eclipse successfully earlier in Ubuntu (Virtual Machine) with following commands:
sudo apt-get install eclipse
sudo apt-get install eclipse-cdt
However, it got messed up when I did an update from its "Install New Software" tab. After running following commands, I removed eclipse completely.
sudo apt-get remove --purge eclipse
sudo apt-get autoremove
sudo rm -rf /usr/bin/eclipse /usr/lib/eclipse/ /usr/share/eclipse /usr/share/man/man1/eclipse.1.gz /etc/eclipse.ini
However, now I want to again install eclipse in my Ubuntu. When I run the above commands, it simply doesn't go well and stop at following execution:
milind#milind-VirtualUbuntuOneiric:~$ sudo apt-get install eclipse
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
eclipse
0 upgraded, 1 newly installed, 0 to remove and 147 not upgraded.
Need to get 0 B/17.3 kB of archives.
After this operation, 131 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
eclipse
Install these packages without verification [y/N]? y
Selecting previously deselected package eclipse.
(Reading database ... 133931 files and directories currently installed.)
Unpacking eclipse (from .../eclipse_3.7.0-0ubuntu1_all.deb) ...
Setting up eclipse (3.7.0-0ubuntu1) ...
milind#milind-VirtualUbuntuOneiric:~$
Trying for so long (with restarting the VBox many times), but no luck. Can you please help me with:
How to install eclipse for C++ (I think indigo) from command line
like earlier I did ?
If command line is not working then what is the latest C++ eclipse site to get it ?
How to install proper CDT for this eclipse so that it can be used
nicely for debugging (which was my root problem) ?
I had a few problems installing from apt recently (Ubuntu 11.10). I eventually ended up downloading a build from here and then installing to a custom location [/home/usrname/programs/eclipse]. This was the only way I could get the marketplace to work.