python pip: no distributions at all found for an existing package - python

I am trying to install the ScientificPython package into a newly installed distribution of Python on a Fedora 14 x64 system. Pip finds ScientificPython in the repository but does not want to install it
[bin]$ sudo ./python2.7 ./pip search ScientificPython
ScientificPython - Various Python modules for scientific computing
[bin]$ sudo ./python2.7 ./pip install ScientificPython
Downloading/unpacking ScientificPython
Could not find any downloads that satisfy the requirement ScientificPython
No distributions at all found for ScientificPython
Storing complete log in /tmp/tmpDLdmjy
Why could this happen?
Thanks!

Have a look at the ScientificPython entry on pypi and you will find that it only contains a link to their project page, no downloadable package or egg (which pip would need to install from). That's why pip told you Could not find any downloads. You will have to install by hand following their instructions.
Bottom line: if pip search lists a given package that doesn't necessarily mean you can pip install it (in most cases you fortunately can).

This may due to the unverified files in the installation package . try with the
--allow-unverified
pip install package_name==version --allow-unverified package_name
example
pip install django-ajax-filtered-fields==0.5 --allow-unverified django-ajax-filtered-fields

The package name is actually scipy, not ScientificPython
Try:
pip install scipy

Related

Could not find a version that satisfies the requirement length-hpi [duplicate]

I am trying to build my own Python package (installable by pip) using the twine package. This is all going well right up until the point where I try to pip install my actual package (so after uploading to PyPi).
So I first run:
python3 setup.py sdist bdist_wheel
In which my setup.py install_requires list looks like this:
install_requires=[
'jupyter_kernel_gateway==2.4.0',
'pandas==1.0.2',
'numpy==1.18.1',
'azure-storage-blob==2.0.1',
'azure-datalake-store==0.0.48',
'psycopg2-binary==2.8.4',
'xlsxwriter==1.2.6',
'SQLAlchemy==1.3.12',
'geoalchemy2==0.6.3',
'tabulate==0.8.2',
'pyproj==1.9.6',
'geopandas==0.4.0',
'contextily==0.99.0',
'matplotlib==3.0.2',
'humanize==0.5.1',
'ujson==1.35',
'singleton-decorator==1.0.0',
'dataclasses==0.6',
'xlrd==1.2.0'],
In my understanding, these install_requires would be installed by pip when installing my own package.
After this I run
python3 -m twine upload --repository testpypi dist/*
To actually upload my package to PyPi. However, when pip installing my package, I get errors that say there are no versions that satisfy the requirements for a lot of the listed requirements. E.g.: ERROR: Could not find a version that satisfies the requirement psycopg2-binary==2.8.4
When I manually install these packages (e.g. pip install psycopg2-binary==2.8.4), they do get installed.
Is there any way to make the pip install of my package actually install the install_requires requirement list succesfully?
You didn't show how your pip install-ing your package, but I'm guessing you're using something like:
pip install your_project --index-url https://test.pypi.org/simple
The issue is that TestPyPI doesn't contain copies of your dependencies that exist on PyPI. For example:
Exists: https://pypi.org/project/psycopg2-binary/2.8.4/
Does not exist: https://test.pypi.org/project/psycopg2-binary/2.8.4/
You can configure pip to fall back on TestPyPI when a package is missing instead by specifying --extra-index-url instead:
pip install your_project --extra-index-url https://test.pypi.org/simple

How to ignore my development project for installing a package with pip

I uploaded my package to testpypi, and installed it via:
pip install -i https://test.pypi.org/simple/ myporj==0.1.6
However it refuse to install it by saying:
Requirement already satisfied: myproj==0.1.6 in ./projs/myproj (0.1.6)
I guess I may add the project in editable mode:
pip install --editable .
However, I know want to disable it. I tried:
python setup.py develop --uninstall
But it has no effect.
It may be worth creating a separate env (Virtual Environments) for the installation.
Here are some articles on this subject:
https://docs.python.org/3/tutorial/venv.html
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment
Or does it need to be installed in the same place?
You can try to find your package pip search myporj or pip list for show all packages.
And uninstall it later pip uninstall myporj (it may require the right of sudo in linux) then install again.
Maybe you may need --no-cache-dir option to ignore the cache during installation. Here is more details: https://pip.pypa.io/en/stable/reference/pip_install/#caching

Can all/most python pip packages be installed using pypy3?

I am able to install the python3 package of forexconnect using:
python3 -m pip install forexconnect
but when I try to install it for pypy using:
pypy3 -m pip install forexconnect
I get the following error,
ERROR: Could not find a version that satisfies the requirement forexconnect (from versions: none)
ERROR: No matching distribution found for forexconnect
I have looked through the pypy documentation and can't work out what I need to do now. Perhaps I need to re-compile/rebuild the library but unfortunately my knowledge of python isn't good enough to understand what is probably quite straight-forward.
Please, does anyone know what is going on here and what needs to be done?
forexeconnect does not release a source tarball, so they must build a binary version for each python version they wish to support and upload that to PyPI. Most packages will release a source tarball and upload that to PyPI, then pip install can build the binary package from source. In this case, the package provider (assuming they do not want to release the source) would have to build a version for PyPy, there is nothing pip nor PyPy can do.
To see supported versions by pip try
pip install forexconnect==0
Then you can set specifical version with
pip install forexconnect==versionnumber

pip install private package

I have one python package A which has depends on another private package named godot(hosted at bitbucket, and should be accessed by git+ssh protocol). In package A's setup.py, I have following code:
...
install_requires=['godot'],
dependency_links=['git+ssh://git#bitbucket.org/xxx/godot.git#egg=godot']
...
I have two questions here:
Now setuptools 1.4 (latest stable version) does not support 'git+ssh' protocol, only code in the development branch handle this protocol: Python setuptools: How can I list a private repository under install_requires?. I have installed the development version via:
pip install --upgrade --force-reinstall hg+https://bitbucket.org/pypa/setuptools#egg=setuptools
I almost solved this bit, but I wonder If any other approach available? Invoke pip install -r requirements.txt(have git+ssh://git#bitbucket.org/xxx/godot.git#egg=godot list in requirements.txt)?
The second question is name conflict. There is another package on pypi also named godot, So when I install package A using follow command, pip install the godot from pypi index:
pip install git+ssh://git#pypi.corp.com/xxx/A.git#egg=A
How could force pip(setup.py) to install the private godot package, rather than the one on pypi index?
For part 1: you can install packages via pip by specifying as:
$ pip install http://my.package.repo/SomePackage-1.0.4.zip
To keep it simple and avoid spending undue time on it, I would just download the .zip source file and install via pip as above.
See here...
For part 2: pip has a --no-dependencies switch. Add that after installing all the dependencies manually

PIP uninstall not looking into /usr/local

I installed several packages (among them patsy and statsmodels) with pip 1.3.1 in kubuntu 13.04. They were put into /usr/local/lib, instead of /usr/lib. When using pip freeze or pip list, these packages appear fine, and are usable in python. However, when I use pip uninstall I get "Can't uninstall 'statsmodels'. No files were found to uninstall." The structure of install packages in /usr/local/lib/python2.7/dist-packages seem correct, and installed-files.txt has everything listed. How do I make pip see these files and uninstall them?
I do not really have a solution for the pip path lookup, but deleting /usr/local/lib/python2.7/dist-packages/_PACKAGE_NAME did the trick for me. At the very least it allowed me to install anew.

Categories