Failure while installing dependencies for odoo - python

So Im studying an odoo course in udemy. But I cant install the dependencies.
Im using ubuntu 20.04
user#ubuntu:~$ sudo apt-get install python-cups python-dateutil python-decorator python-docutils python-feedparser
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-cups
E: Unable to locate package python-feedparser

Try running following commands:
sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python-cups python-dateutil python-decorator python-docutils python-feedparser

You Have to download the correct dependencies for odoo based on your ubuntu version.
Dependencies for ubuntu 20.04 are here:
https://websiteforstudents.com/how-to-install-odoo-on-ubuntu-20-04-18-04/

Related

E: Unable to locate package python-pygraphviz E: Package 'ipython' has no installation candidate

I wanted to use ns3 for which some prerequisites have to be met in Ubuntu. (https://www.nsnam.org/wiki/Installation)
First of all I cannot use apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev ipython command as it shows :E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
When I write the same command as root user,sudo apt-get install gir1.2-goocanvas-2.0 python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython ipython3
The command line interface shows,
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ipython 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: Unable to locate package python-pygraphviz
E: Package 'ipython' has no installation candidate
What should I do ? Can anybody help me?
This should work
# Install pip
sudo apt install -y python3-pip
# Install ipython
pip3 install ipython
Source: https://askubuntu.com/questions/1298398/e-package-ipython-has-no-installation-candidate-while-trying-to-install-tor
Try executing the following command:
sudo apt install ipython
then do the follwing:
sudo apt install python3-pygraphviz
or
sudo apt-get install python3-pygraphviz

Problems instaling libpq-dev in ubuntu 20.04

I am currently trying to install libpq-dev to install psycopg2. The problem is, when I try to install it, an error occurs saying I don't have the latest libpq5 version. However when I try to download the newer version of libpq5 the system says that I already have the latest version. An example of the error.
lhmendes#lhmendes-GA-78LMT-S2P:~$ sudo apt-get install libpq-dev
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:
libpq-dev : Depends: libpq5 (= 12.4-0ubuntu0.20.04.1) but 12.4-1.pgdg20.04+1 is to be installed
E: Unable to correct problems, you have held broken packages.
lhmendes#lhmendes-GA-78LMT-S2P:~$ sudo apt-get install libpq5
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpq5 is already the newest version (12.4-1.pgdg20.04+1).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
As of late January 2023 the command is:
sudo apt-get install libpq5=12.12-0ubuntu0.20.04.1 && sudo apt-get install libpq-dev
When you're using Ubuntu 22.04 try:
sudo apt-get install libpq5=14.5-0ubuntu0.22.04.1 && sudo apt-get install libpq-dev
Any newer version of libpq5 can cause this error. In my case it was libpq5=13.1-1.pgdg20.04+1.
It's the similar answer as furus has given but the change is it's libpq5 in ubuntu 20.04 (atleast in my case).
I fixed the issue by installing
sudo apt-get install libpq5=12.5-0ubuntu0.20.04.1
and then install liqpq-dev again
sudo apt-get install libpq-dev
I would say you have installed the latest libpq (12.4-1) but libpq-dev needs older version (12.4-0) and this makes problem.
You may try to install older libpq
apt-get install libpq==12.4-0ubuntu0.20.04.1
but if other program uses the latest version then older version can make problem with this program.
pgdg20 in 12.4-1.pgdg20.04+1 means it is not module from standard ubuntu repo but from some other repo - probably postgresql repo - and maybe this repo has also the latest version libpq-dev. You would search 12.4-1.pgdg20.04+1 in Google and maybe you could find also libpg-dev with 12.4-1.pgdg20.04+1
I found libpq-dev 12.4-1.pgdg20.04+1 and you can download .deb file and install it.
Or you can add this postgresql repo and install with apt-get. This method will also inform about updates and then you could install updates automatically.
This worked for me:
sudo apt-get install libpq5=12.7-0ubuntu0.20.04.1
if you are trying to install it on Ubuntu 20.04 then run below command to install libpq-dev
Command1: sudo apt-get install libpq5=12.2-4
Command2:
sudo apt install libpq-dev
Link: https://ubuntu.pkgs.org/20.04/ubuntu-main-arm64/libpq-dev_12.2-4_arm64.deb.html
What worked in my case was.
sudo apt-get install libpq5=14.5-0ubuntu0.22.04.1
The libpq5 package that worked for me corresponds to my version of ubuntu I found it at:
https://pkgs.org/download/libpq-dev
For ubuntu version 22.04.1
Then I was able to use sudo apt-get install libpq-dev without problems.
I had to download this package and run
sudo dpkg -i ~/Downloads/libpq-dev_13.3-1.pgdg20.04+1_amd64.deb
I have the same problem when I install psycopg2-binary, It seems like it is caused by repository conflict.
In software & Updates => other software
Unselect https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal.
sudo apt-get remove libpg5
sudo apt-get install libpg5 libpg-dev
Solved my problem
This problem persists in 22.04:
Os pacotes a seguir têm dependências desencontradas:
libpq-dev : Depende: libpq5 (= 14.3-0ubuntu0.22.04.1) mas 14.4-1.pgdg22.04+1 está para ser instalado
I had to revert libpq5 as per the error message above:
sudo apt-get install libpq5=14.3-0ubuntu0.22.04.1
I think this is because your libpg-dev is depending on libpg5=12.4-0ubuntu0.20.04.1 but 12.4-1.pgdg20.04+1 is to be installed in your machine that is why the error occurs when you sudo apt-get install libpg-dev.
Therefore you can try sudo apt-get install libpg5=12.4-0ubuntu0.20.04.1 first,
after that, sudo apt-get install libpg-dev.
I did this way to solve my problem which was similar to yours.
Update package worked for me:
sudo apt update
sudo apt install libpg-dev
You can find the latest version here.
https://packages.ubuntu.com/bionic/libpq-dev
The only solution that worked for me is
sudo apt-get install libpq5=14.5-0ubuntu0.22.04.1
sudo apt-get install libpq-dev
then
pip install psycopg2
Yes, upvote when this works for you.
Good luck.
This issue was fixed in pgadmin repo: it now provides a matching version of libpq-dev along with libpq5. You can update both packages to the latest version and remove pins (unless there is yet another flawed provider of the libpq5 package in your apt sources).
$ dpkg -l libpq*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-==================-============-============================================
ii libpq-dev 15.1-1.pgdg20.04+1 amd64 header files for libpq5 (PostgreSQL library)
ii libpq5:amd64 15.1-1.pgdg20.04+1 amd64 PostgreSQL C client library

Package 'python-tk' has no installation candidate

I am trying it install Tinker on my Ubuntu 17.04 but some how it does not seem working, I have used all these command on the terminal
sudo apt-get install update
sudo apt-get install upgrade
sudo apt-get install python-tk
sudo apt-get install python3-tk
Every time I am getting :
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-tk 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-tk' has no installation candidate

Unable to install python pip on Ubuntu 14.04

This is the command I used to install python-pip
sudo apt-get install python-pip
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:
python-pip : Depends: python-setuptools (>= 0.6c1) but it is not going to be installed
Recommends: python-dev-all (>= 2.6) but it is not installable
E: Unable to correct problems, you have held broken packages.
I already installed the latest version of python-dev
When i try to install python-setuptools using
sudo apt-get install python-setuptools I get the below 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:
python-setuptools : Depends: python-pkg-resources (= 3.3-1ubuntu1) but 3.3-1ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
Explain me how to resolve the error and guide me the steps to get python-pip installed.
got the same error when I install python-pip, the following command solved my problem.
sudo apt-get install python-pkg-resources=3.3-1ubuntu1
sudo apt-get install python-setuptools
download pip from https://bootstrap.pypa.io/get-pip.py
Then run the following (which may require administrator access):
python get-pip.py
This should get you going.
If you get stuck again, read here: http://pip.readthedocs.org/en/stable/installing/
In addition to the solution that #seems recommended, I had to run this.
apt-get update
(OR)
sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install pip
i have the same issue, and eventually i gave up by using:
sudo apt-get install python-pip
after tryings something like:
sudo apt-get install python-setuptools python-dev build-essential
but with no luck.
So all i did then was to:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
peace of mind.....
I think you should try:
sudo apt-get install python-pkg-resources=3.3-1ubuntu1
And then:
sudo apt-get install python-pip python-dev build-essential
It will definitely solve your issue.
Jut run this command :
sudo apt-get update
than install python tools :
sudo apt-get install python-pip
sudo apt-get install python-dev
sudo apt-get install build-essential
All the packages will get installed or some of them may say its already latest version, Thats fine

You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application

I am working on Django project with virtualenv and connect it to local postgres database. when i run the project is says,
ImportError: No module named psycopg2.extensions
then i used this command to install
pip install psycopg2
then during the installation it gives following error.
Downloading/unpacking psycopg2==2.4.4
Downloading psycopg2-2.4.4.tar.gz (648kB): 648kB downloaded
Running setup.py (path:/home/muhammadtaqi/Projects/MyProjects/OnlineElectionCampaign/venv/build/psycopg2/setup.py) egg_info for package psycopg2
Error: You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Error: You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/muhammadtaqi/Projects/MyProjects/OnlineElectionCampaign/venv/build/psycopg2
Storing debug log for failure in /home/muhammadtaqi/.pip/pip.log
Use these following commands, this will solve the error:
sudo apt-get install postgresql
then fire:
sudo apt-get install python-psycopg2
and last:
sudo apt-get install libpq-dev
I just run this command as a root from terminal and problem is solved,
sudo apt-get install -y postgis postgresql-9.3-postgis-2.1
pip install psycopg2
or
sudo apt-get install libpq-dev python-dev
pip install psycopg2
Just install libpq-dev
$ sudo apt-get install libpq-dev
For me this simple command solved the problem:
sudo apt-get install postgresql postgresql-contrib libpq-dev python-dev
Then I can do:
pip install psycopg2
For Python 3, I did:
sudo apt install python3-dev postgresql postgresql-contrib python3-psycopg2 libpq-dev
and then I was able to do:
pip3 install psycopg2
They changed the packaging for psycopg2. Installing the binary version fixed this issue for me. The above answers still hold up if you want to compile the binary yourself.
See http://initd.org/psycopg/docs/news.html#what-s-new-in-psycopg-2-8.
Binary packages no longer installed by default. The ‘psycopg2-binary’ package must be used explicitly.
And http://initd.org/psycopg/docs/install.html#binary-install-from-pypi
So if you don't need to compile your own binary, use:
pip install psycopg2-binary
You must setup postgresql-server-dev-X.Y, where X.Y. your's servers version, and it will install libpq-dev and other servers variables at modules for server side developing.
In my case it was
apt-get install postgresql-server-dev-9.5
Reading package lists... Done
Building dependency tree Reading state information... Done The
following packages were automatically installed and are no longer
required: libmysqlclient18 mysql-common Use 'apt-get autoremove' to
remove them. The following extra packages will be installed:
libpq-dev Suggested packages: postgresql-doc-10 The following NEW
packages will be installed: libpq-dev postgresql-server-dev-9.5
In your's case
sudo apt-get install postgresql-server-dev-X.Y
sudo apt-get install python-psycopg2
I was using a virtual environment on Ubuntu 18.04, and since I only wanted to install it as a client, I only had to do:
sudo apt install libpq-dev
pip install psycopg2
And installed without problems. Of course, you can use the binary as other answers said, but I preferred this solution since it was stated in a requirements.txt file.
Run the command below;
sudo apt-get install python-pip python-dev libpq-dev postgresql postgresql-contrib
pip install psycopg2
In my case, I was facing this problem when I ran pip install -r requirements.txt to install all packages for a Django project with PostgreSQL database on an Ubuntu machine, I ran into this error and many other installation errors.
To solve this one, I ran the following commands:
sudo apt install postgresql postgresql-contrib
sudo apt install libpq-dev
sudo apt install python3-dev
sudo apt install python3-pip
sudo apt install python3-psycopg2
pip3 install psycopg2
pip3 install psycopg2-binary
Plus, also check if the Ubuntu and Python and Psycopg versions are compatible together.
Also, pip install aiopg, solve the issue when i ran into it the second time.

Categories