No matching distribution found while using pip - python

I've been trying to install Pybossa and I've been trying to follow these steps from the documentation, and this link too (which they're the same).
when it comes to using this command pip install -r requirements.txt it keeps running some installations and then and error occurred :
ERROR: Could not find a version that satisfies the requirement jeepney==0.4 (from pybossa==3.1.2->-r requirements.t
xt (line 3)) (from versions: none)
ERROR: No matching distribution found for jeepney==0.4 (from pybossa==3.1.2->-r requirements.txt (line 3))
this is what's inside requirements.txt :
I don't know why this is happening as i'm following the documentation .. so i'd glade if anyone helped me.
I'm using :
Ubuntu server 18.04
python 2.7
virtualenv
PostgreSQL

You are better off going for latest python 3. python 2 had its eol early this year. For new approaches it would be a dead end.
I am on 16.04, but hope you can do the turn likewise
make use of native venv option, don't use virtualenv any more
during the setup you likely will get compilation errors. Those are due to the fact not having a fully equipped build machine. It's very likely that you need to apt-get install more or less dev packages to your system. It depends how deep you had done gcc compilation in the past. For me it was:
sudo apt-get install python3-dev
sudo apt-get install libsasl2-dev libldap2-dev libssl-devm
whenever you encounter compilation errors like this:
Modules/constants.h:7:18: fatal error: lber.h: No such file or directory
compilation terminated.
you need to find the appropriate dev lib and add it to the system with apt-get like mentioned above by easiest looking the error up in your favorite internet search engine
Steps for the setup of pybossa
python3 -m venv ./pb_env
. ./pb_env/bin/activate
pip install --upgrade pip
mkdir pb #shorthand for pybossa
cd pb
git clone --recursive https://github.com/Scifabric/pybossa
cd pybossa/
pip install -r requirements.txt
feel free to ask again if you still get stuck.

All versions of jeepney starting with 0.1 (released in 2017) requires Python >= 3.5.

Related

Cannot install awesomeversion==22.9.0 because these package versions have conflicting dependencies

I've never done any Python so I'm not familiar with the package versions and dependencies system overall. I'm trying to run this repo https://github.com/Maaxion/homeassistant2influxdb
For this, I want to use Docker. So once I've cloned the repo, I've added this Dockerfile at the root and followed what was explained in the readme to the best I could:
FROM ubuntu:18.04
RUN apt update -y
RUN apt install python3 python3.7-dev python3-venv python3-pip git -y
WORKDIR /home
COPY . .
RUN git clone --depth=1 https://github.com/home-assistant/core.git home-assistant-core
RUN python3 -m venv .venv
RUN . .venv/bin/activate
RUN python3 -m pip install --upgrade --force pip
RUN pip3 install -r home-assistant-core/requirements.txt
RUN pip3 install -r requirements.txt
It goes fine until it tries to install with pip3 with that line: pip3 install -r home-assistant-core/requirements.txt and I get:
Collecting atomicwrites-homeassistant==1.4.1
Downloading atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl (7.1 kB)
ERROR: Cannot install awesomeversion==22.9.0 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested awesomeversion==22.9.0
The user requested (constraint) awesomeversion==22.9.0
To fix this you could try to:
loosen the range of package versions you've specified
remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
I'm really not sure how to solve this despite taking a look at the link above...
Is it something to do with pip3? Have I missed something in the Dockerfile? How can I solve that issue? I've been looking online but there doesn't seem to be silver bullet answer for this kind of issues.
Could anyone provide some guidance? Thanks!
Try not to specify a direct version, like awesomeversion>=22.4.0 in your requirements.txt file.
What has probably happened is that one of the other requirements is specified as coolRequirement >= somenumber, (or just coolRequirement).
This means that pip is grabbing the latest recommended release for your python version. One of these requirements probably conflicts with something that awesomeversion==22.9.0 requires. One possible solution would be to change awesomeversion==22.9.0 to awesomeversion>=22.9.0, but that may not work if newer versions of awesomeversion break something else.
The real solution would be to figure out what versions of the other requirements worked in the past, and lock those down the same way that awesomeversion is specified.

error pip installing a package that depends on a distutils installed package (docker)

I'm running these commands building a docker from code in a dockerfile, but I think this would be a problem with regular pip install too.
The line
RUN git clone https://github.com/<my-github-name/quail.git && cd quail/ && git fetch origin && git branch --track <local-branch-name> origin/<remote-branch-name> && git checkout <new-local-branch-name> && pip install -e .
throws the error
Cannot uninstall 'ply'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
I'm aware of this error with pip>8.0 and why pip adopted this behavior, but I'm not sure how I can get around it. In dockerfiles, I usually do so with pip's --ignore-installed flag, but ply is a dependency of a dependency of the quail package I'm installing.
I also need to make this docker portable to others who may and may not already have ply installed locally.
Thanks
edit: ended up using the ugly solution of downgrading pip RUN pip install pip==8.0.1 for the install and immediately re-upgrading to 10.0.1 afterward. Definitely still open to cleaner fixes!

What is "pkg-resources==0.0.0" in output of pip freeze command

When I run pip freeze I see (among other expected packages) pkg-resources==0.0.0. I have seen a few posts mentioning this package (including this one), but none explaining what it is, or why it is included in the output of pip freeze. The main reason I am wondering is out of curiosity, but also, it seems to break things in some cases when trying to install packages with a requirements.txt file generated with pip freeze that includes the pkg-resources==0.0.0 line (for example when Travis CI tries to install dependencies through pip and finds this line).
What is pkg-resources, and is it OK to remove this line from requirements.txt?
Update:
I have found that this line only seems to exist in the output of pip freeze when I am in a virtualenv. I am still not sure what it is or what it does, but I will investigate further knowing that it is likely related to virtualenv.
According to https://github.com/pypa/pip/issues/4022, this is a bug resulting from Ubuntu providing incorrect metadata to pip. So, no there does not seem to be a good reason for this behaviour. I filed a follow-up bug with Ubuntu. https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463
To backup the previous answer, it should be safe to remove that line from your requirements.txt. Here is an example Make file stanza that safely freezes your package list (drop in your Makefile and run with make freeze):
freeze:
pip freeze | grep -v "pkg-resources" > requirements.txt
edit 2022 July 06:
I have been informed that the package name differs depending on the system in use (pkg-resources vs pkg_resources). Please see the comments attached to this answer for differences in usage between different versions of Debian/Ubuntu. As pkg-resources is the historically correct package name at the time this was posted (almost 6 years ago) for the system in question, it will remain unchanged in this answer.
As for the part of your question "is it OK to remove this line?":
I have the same issue here developing on an ubuntu 16.04 with that very line in the requirements. When deploying on a debian 8.5 running "pip install -r requirements.txt" pip complains that pkg-resources is "not found" but there is a global package installed "python-pkg-resources" so the dependency should be satisfied. Same on ubuntu: The package exists there as well.
As stated here it seems to be some "implicitly installed package".
So: If you are on a Debian/Ubuntu having python-pkg-resources installed it should be safe to remove that line. I did so and everything is running fine. However since I am no expert on this you should keep in mind that this might lead to complications when deploying on another machine.
found this answer in this link: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463
by: Louis Bouchard (louis) wrote on 2019-11-16:
It worked for me. But Iḿ not an expert so, if someone undestend it better, would be great if explained it.
Hello,
for what it's worth, the problem comes from the debianized version of virtualenv which uses a debundled version of pkg_resource which gets added into the virtualenv at creation time :
$ virtualenv .
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/caribou/git/quividi/test/bin/python2
Also creating executable in /home/caribou/git/quividi/test/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
$ pip freeze
pkg-resources==0.0.0
Using the pip installed version of virtualenv can be a workable workaround :
$ sudo apt -y purge python3-virtualenv virtualenv tox
$ pip install virtualenv
$ virtualenv .
pip install virtualenv
Collecting virtualenv
Downloading https://files.pythonhosted.org/packages/c5/97/00dd42a0fc41e9016b23f07ec7f657f636cb672fad9cf72b80f8f65c6a46/virtualenv-16.7.7-py2.py3-none-any.whl (3.4MB)
100% |████████████████████████████████| 3.4MB 351kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-16.7.7
$ virtualenv .
New python executable in /home/caribou/git/quividi/test/bin/python
Installing setuptools, pip, wheel...
done.
$ source bin/activate
$ pip freeze
$

Offline installation for pip packages fails with error "Could not find a version that satisfies the requirement"

In order to make packages installed offline, I use the -d (or --download) option to pip install. For instance, pip install --download dependencies -r requirements.txt will download the packages for all required dependencies mentioned in requirements.txt to dependencies dir (but will not install them). Then I use pip install --no-index --find-links dependencies -r requirements.txt to install those downloaded packages without accessing the network.
Most of the time it works fine, but sometimes installation fails with error "Could not find a version that satisfies the requirement xyz". After doing pip install --user xyz --find-links dependencies manually (xyz IS present in the dependencies folder), installation fails with the same "Could not find a version that satisfies the requirement abc" error, but with different package 'abc'. It repeats several times until I manually resolve all failed dependencies.
How could I make run pip install --no-index --find-links dependencies -r requirements.txt without those weird dependency errors not finding packages that are already there?
Make sure of two things:
The pip version is the same in the offline server and in the online one.
To find out: pip -V
To update (if needed): pip install --upgrade pip
The python version is the same in both virtual enviroments or servers.
To find out: python (the header will have the version info)
In my case I was calling pip install --download outside the virtual environment (using default python version - 2.7) and then installing in a virtual environment with python 3 and the error I got was exactly the one you mentioned.

Error when attempting to install django-toolkit within a python virtualenv

I'm relatively new to Python, extremely new to Django and Heroku, and also rather new to working in the terminal.
I'm attempting to follow the instructions on setting up a Django Heroku project found here. I'm getting stuck at the following command:
pip install django-toolbelt
I keep getting the following error:
Error: pg_config executable not found.
I don't know if any of this is even remotely related to the problem, but these are the things I've tried so far:
Tried reinstalling the django-toolbelt (just running the command again)
Tried switching from Postgres.app to the full Mac OSX install
No luck. What am I missing?
EDIT: Per Midimo's suggestion, I tried installing python-dev. This is what happened:
(venv)Macbook:[SITE] [USER]$ pip install python-dev
Downloading/unpacking python-dev
Could not find any downloads that satisfy the requirement python-dev
Cleaning up...
No distributions at all found for python-dev
Storing complete log in /Users/[USER]/.pip/pip.log
EDIT 2: And this is what happened when I tried to install libpq-dev...
(venv)Macbook:[SITE] [USER]$ pip install libpq-dev
Downloading/unpacking libpq-dev
Could not find any downloads that satisfy the requirement libpq-dev
Cleaning up...
No distributions at all found for libpq-dev
Storing complete log in /Users/[USER]/.pip/pip.log
do you have python-dev installed?
If you did, try installing libpq-dev
Before installing django-toolbelt you have to install those following dependencies:
$ sudo apt-get install python-dev python-psycopg2 libpq-dev
And then in the virtualenv:
(myven)trinh#trinh-pc:/path/to/django/project$ pip install django-toolbelt
Source :
I had same problem: one of the messages was couldn't run pg_config. Despite fact I had pg_config on my PATH and had restarted terminal to be sure.
My solution was to just run pg_config right before pip install django-toolbelt.
install than ran without any errors.
Just in case this will help anyone.
I'm working through this on Windows and was having this problem while trying to install django-toolbelt via pip in a virtualenv.
I had to add the entire directory to my PATH and make sure that Program Files was in quotes --
PATH=$PATH:/c/"program files"/postgresql/9.4/bin/
I was trying to get this work for hours so hopefully this helps someone else!
You need Postgres on you Mac because the django-toolbelt will try to install psycopg2 that won't find the path for the database and will raise the error.
The easiest solution is to install the Postgres.app and then add to the .profile file located on your home folder the following and restart or just run the command manually in the terminal:
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
Now you are ready to install the toolbelt

Categories

Resources