Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus pypi repository "Could not find a version that satisfies the requirement"

Tags:

python

pip

nexus

Using nexus 3 I configured a proxy python repository using "https://pypi.org" as remote storage. The url of the repository is "http://localhost:8081/repository/pypi/".

Then i used pip to install packages using nexus repository, in $HOME/.config/pip/pip.conf I have the following configurations:

[global]
index = http://localhost:8081/repository/pypi/pypi
index-url = http://localhost:8081/repository/pypi/stable
trusted-host = localhost

Now when I run pip search pexpect it works fine :

User for localhost:8081: someuser
Password: 
pexpect (4.7.0)                  - Pexpect allows easy control of interactive console applications.
pexpect-serial (0.0.4)           - pexpect with pyseriat
...

But when I run pip install pexpect I get the following error :

Collecting pexpect
User for localhost:8081: someuser
Password: 
  Could not find a version that satisfies the requirement pexpect (from versions: )
No matching distribution found for pexpect

Do I need extras configurations in pip.conf or inside my nexus repository ?

like image 227
BOUKANDOURA Mhamed Avatar asked Jul 17 '19 09:07

BOUKANDOURA Mhamed


People also ask

How do I download a Python package from Nexus repository?

To download packages from Nexus instead of Pypi , we need to config pip. ini , most of the time, its not only speed up build processes by caching commonly used dependencies but also help ensuring reproducible builds, since one only depends on their Nexus availability and not the public repositories.

Could not find a version that satisfies the requirement OS from versions none?

Solution 1: Just update pip You just need to update pip and your error will be resolve. Just follow this command. If you are windows users Then run this command. And then also upgrade setuptools after doing the above.

What is Nexus Python?

Description. python-nexus provides simple nexus file-format reading/writing tools, and a small collection of nexus manipulation scripts. Note: Due to a name clash with another python package, this package must be installed as pip install python-nexus but imported as import nexus .

What is sonatype work directory?

The Sonatype Work directory sonatype-work is created as a sibling to the nexus application directory, and the location of this directory can be configured via the nexus. properties file which is described in Configuration Directory. This directory contains a log of all IP addresses accessing the repository manager.


2 Answers

You should change this:

[global]
index = http://localhost:8081/repository/pypi/pypi
index-url = http://localhost:8081/repository/pypi/stable
trusted-host = localhost

to this (swapping stable for simple):

[global]
index = http://localhost:8081/repository/pypi/pypi
index-url = http://localhost:8081/repository/pypi/simple
trusted-host = localhost
like image 197
Clintm Avatar answered Oct 12 '22 23:10

Clintm


As an alternative, you can install the packages without modifying the config:

If you Nexus PyPi repository is http://localhost:8081/repository/pypi/:

# To install, mind trailing /simple
pip install -i http://localhost:8081/repository/pypi/simple pexpect

# To search, mind trailing /pypi
pip search -i http://localhost:8081/repository/pypi/pypi pexpect

Source: Nexus docs

like image 45
The Godfather Avatar answered Oct 12 '22 22:10

The Godfather