PyPiServer debugging "could not find a version that satisfies the requirement" - python

I'm creating a private package repository using PyPiServer. I'm serving this on one VPS instance and trying to pip install from another.
Traceback from pip:
root#managersvr:~# pip install --index-url http://<IP>:8080/simple/ global_toolkit --trusted-host <IP>
Could not find a version that satisfies the requirement global_toolkit (from versions: )
No matching distribution found for global_toolkit
root#managersvr:~#
Server logs from PyPi:
[02/May/2020 23:57:10] "GET /simple/global-toolkit/ HTTP/1.1" 200 313
I'm struggling to debug. Steps taken so far:
- I have run pip install --upgrade pip
- I have navigated to the PyPi IP address in browser, which correctly displays:
Welcome to pypiserver!
This is a PyPI compatible package index serving 1 packages.
To use this server with pip, run the following command:
pip install --index-url http://<IP>:8080/simple/ PACKAGE [PACKAGE2...]
To use this server with easy_install, run the following command:
easy_install --index-url http://<IP>:8080/simple/ PACKAGE [PACKAGE2...]
The complete list of all packages can be found here or via the simple index.
This instance is running version 1.3.2 of the pypiserver software.
Navigating to the "here" link for a complete list of all packages yields:
Index of packages
global_toolkit.tar.gz
And navigating to the simple index yields:
Simple Index
global-toolkit
I also tried using global-toolkit instead of global_toolkit.
I am looking for steps to identify the layer at which there is an error, and debug it. Thanks.
UPDATE
I found the pip search command. The output is, strange:
(venv) root#managersvr:~# pip search --index http://<IP>:8080 global_toolkit
global_toolkit () -

I've resolved the issue. In hindsight I should have foreseen the problem. I failed to include my ext_modules value in the top level setup.py (so the cython modules weren't compiled). A good tip for debugging: use the -v flag!

Related

LDAP installation for Python without Pip and .org's

i want to use LDAP with python and dont have the opportunity to use pip with pypi.python.org, pypi.org and files.pythonhosted.org. (cant get through Proxy, wont change)
so i need to download the package and install it.
as i understand there are .whl and zipped packages.
i tried bonsai but got the error C1083 because of the missing file basetsd.h
i tried python_ldap but it called for pyasn1, so i tried to install pyasn1 but it gave me a 407 Proxy Authorization Required -- Some packages may not be found Line with Error "Could not find suitable distribution for Requirement.parse('pyasn1<0.5.0,>=0.4.6')
There where no red or yellow errors so i tried python_ldap again, but with the same error like on the first attempt.
how do i setup a LDAP for Python if i cant reach pypi.python.org, pypi.org and files.pythonhosted.org ?
Greetings
Chorum
Python: 3.10.1
Pip: 21.2.4

Why wouldn't this project I published to PyPI install with pip?

I've published a project to PyPI for the first time (https://pypi.org/project/xontrib-autojump/). But I get the following error when I try to install the project with this pip command:
$ pip install xontrib-autojump --user
Collecting xontrib-autojump
Could not find a version that satisfies the requirement xontrib-autojump (from versions: 0.1.linux-x86_64, 0.2.linux-x86_64, 0.3.linux-x86_64, 0.4.linux-x86_64)
No matching distribution found for xontrib-autojump
This project does appear when I run pip search xontrib-autojump:
$ pip search xontrib-autojump
xontrib-autojump (0.4) - autojump support for xonsh
...
Why can't I install this package with pip?
There are a number of possible problem areas - the main one is that it looks to me that you have not followed the naming convention needed to specify which python version the download is suitable for.
It is also a very good idea to set the metadata as this assist with finding packages.
The Packaging Tutorial is very helpful on this. It is also recommend that you test the upload and install process using the test instance of pypi.
The other big problem st that you "package" does not contain any python code and is not a python package in any way shape or form.

Error while installing pip using get-pip.py with Python2.7.10

I am using Python2.7.10 on a Windows10 machine, and wish to install pip.
I followed the instructions from here to get the get-pip.py file, but when I try to run it I get the following error:
Could not install packages due to an EnvironmentError: [Errno 42] Illegal byte sequence
I found that if I install an older version of pip (for Python2.6) then the installation is successful, and I can use pip regularly. If I try to use this older version (9.0.3) to install the newer one (18.0) then I get the same error message.
The complete log of the installation is below (1). If I manually install setuptools then I get the same message when it tries to download the next package:
Any assistance with installing the newer version will be much appreciated :-)
1)
C:\Python27\Lib\site-packages>python get-pip.py
Collecting pip
Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/ff/f4/385715ccc461885f3cedf57a41ae3c12b5fec3f35cce4c8706b1a112a133/setuptools-40.0.0-py2.py3-none-any.whl (567kB)
1% |Could not install packages due to an EnvironmentError: [Errno 42] Illegal byte sequence
Update: after installing several packages manually I was able to install the new pip version. It obviously didn't solve the problem, and pip is still not working. When trying to use it, the same error message appears at every attempted download. See log at (2). I double checked the address, and it appears to be correct.
2)
Collecting Requests
Downloading https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (91kB)
11% |Could not install packages due to an EnvironmentError: [Errno 42] Illegal byte sequence
Thanks
tl;qr - add the quiet flag (-q) to your command
While trying to debug I redirected the output to a file:
python -m pip install requests > .\temp.txt
Surprisingly, everything suddenly worked!
It appears there is a known bug (Thanks Matan M) while displaying the progress bar to the console. Basically, any solution that would avoid writing it would work.
Here are some options:
Use the -q flag
Turn off the progress bar using --progress-bar off
Redirect to a temp file
:-)
Hi check if you added the relevant python paths to the PATH.
pip install <package> -q **or**
--progress-bar off

Unable to install dns with pip after upgrading pip

Log speaks for itself. I ran pip and it said I needed to upgrade it, so I did. Now I still can't install dns.
~/electrum/python electrum
Error: No module named 'dns'. Try 'sudo pip install <module-name>'
~/electrum/pip install dns
Collecting dns
Could not find a version that satisfies the requirement dns (from versions: )
No matching distribution found for dns
~/electrum/git log
commit c8e67e2bd07efe042703bc1368d499c5e555f854 (HEAD -> master, origin/master, origin/HEAD)
Author: ThomasV <thomasv#electrum.org>
It seems that you need "dnspython" package, which is imported by "dns" name that's why you getting No module named 'dns' message :) Try this
pip install dnspython

Error when using pip install: "Could not find a version that satisfies the requirement <package-name>"

I'm trying to install django-trumbowyg https://github.com/sandino/django-trumbowyg to my app
When I did pip install django-trumbowyg, it returned this error:
Could not find a version that satisfies the requirement django-trumbowyg (from versions: )
No matching distribution found for django-trumbowyg
Does anyone know what this means? And how I can fix it?
As https://pypi.python.org/pypi/django-trumbowyg#downloads shows, there's only a binary package for Python2 at PyPI.
So, you have to install the package directly from the official sources as pointed out by Rishav in the meantime.
Then ask the developer to upload a source package to PyPI and/or build the wheel as universal.
You may also get this error if your company firewall doesnt allow any package from external source. you might need to add a proxy in that case.
for example: pip install django-trumbowyg --proxy=proxy.companydomain.com:

Categories