Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install package published in private PyPI repository #1958

Closed
3 tasks done
IamGianluca opened this issue Jan 29, 2020 · 5 comments
Closed
3 tasks done

Cannot install package published in private PyPI repository #1958

IamGianluca opened this issue Jan 29, 2020 · 5 comments
Labels
kind/bug Something isn't working as expected

Comments

@IamGianluca
Copy link

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Ubuntu 18.04
  • Poetry version: 1.0.2
  • Link of a Gist with the contents of your pyproject.toml file:
[tool.poetry]
name = "bidding"
version = "1.0.0-beta"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.6"
pandas = "^0.25.3"
numpy = "^1.18.1"
scikit-learn = "^0.22.1"
lightgbm = "^2.3.1"
pyarrow = "^0.15.1"
dvc = {extras = ["gs"], version = "^0.82.3"}
joblib = "^0.14.1"
jupyterlab = "^1.2.4"
matplotlib = "^3.1.2"
psycopg2-binary = "^2.8.4"
pystan = "^2.19.1"
google-cloud-bigquery = "^1.23.1"

[tool.poetry.dev-dependencies]
black = "^19.10b0"
flake8 = "^3.7.9"
ipdb = "^0.12.3"
mypy = "^0.761"
pytest = "^5.3.4"
pytest-cov = "^2.8.1"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

Issue

First of all, thank you for the great tool! 👏

I have an issue when trying to pip install a package I published in a private PyPI repository using poetry.

Below are the steps I've used to publish the library

$ poetry build
Building bidding (1.0.0-beta)                                                                                                                                                          
 - Building sdist                                                                                                                                                                      
 - Built bidding-1.0.0b0.tar.gz                                                                                                                                                        
                                                                                                                                                                                       
 - Building wheel                                                                                                                                                                      
 - Built bidding-1.0.0b0-py3-none-any.whl
$ poetry publish -r mypypi
                                                                                                                                                                                       
Publishing bidding (1.0.0-beta) to mypypi                                                                                                                                             
 - Uploading bidding-1.0.0b0-py3-none-any.whl 100%                                                                                                                                     
 - Uploading bidding-1.0.0b0.tar.gz 100%

To reproduce the issue, I created a new virtual environment through pyenv, activated it, and finally tried to install the library via pip.

$ pyenv virtualenv myenv
$ pyenv activate myenv
$ python -V
Python 3.7.5
$ pip install -i https://pypi.prod.mypypi.us/simple/ bidding
Looking in indexes: https://pypi.prod.mypypi.us/simple/
Collecting bidding
User for pypi.prod.mypypi.us: gianluca
Password: 
  Downloading https://pypi.prod.mypypi.us/api/package/bidding/bidding-1.0.0b0-py3-none-any.whl
Collecting pystan<3.0.0,>=2.19.1 (from bidding)
  ERROR: Could not find a version that satisfies the requirement pystan<3.0.0,>=2.19.1 (from bidding) (from versions: none)
ERROR: No matching distribution found for pystan<3.0.0,>=2.19.1 (from bidding)
User for pypi.prod.mypypi.us: gianluca
Password: 

I've tried this a bunch of times and the error message is the same, although the dependencies might change from time to time ― e.g., pandas, numpy, pystan.

@IamGianluca IamGianluca added the kind/bug Something isn't working as expected label Jan 29, 2020
@IamGianluca
Copy link
Author

@sdispater Can you see anything in the way I've built and published my library?

For the sake of completeness, I've also tried to install the dependency from a Python 3.6.5 environment and encountered the same exact issue.

@romaingz
Copy link

romaingz commented Feb 6, 2020

Hello @IamGianluca
I am also using a private repository.
I have not tried publishing to it through poetry yet, but I install from it without any issue.

One difference I see is that I specify it in my pyproject.toml (doc for reference):

[[tool.poetry.source]]
name = "foo"
url = "https://foo.bar/simple/"

How does this behave in your case?

@pwoolvett
Copy link
Contributor

What libraries does your private index have? I think the message you're getting is because pip cannot find the dependencies (pystan) of your library in the index you told it to use.

Have you tried running something like this?
pip install --index-url https://pypi.prod.mypypi.us/simple/ --extra-index-url https://pypi.org/ bidding

This way, pip can also look into the public pypi for all other packages.

If I'm right, another option would be to also upload your libary deps to your private repo...

@romaingz would not have this issue because the the command poetry runs internally already does this:

Command ['...pip', 'install', '--no-deps', '--index-url', 'https://pypi.prod.mypypi.us/simple', '--extra-index-url', 'https://pypi.org/', 'bidding==...'

@IamGianluca
Copy link
Author

Thank you for your reply @pwoolvett !

As you pointed out, the issue was that my private repository did have a copy of the dependencies needed by my library. I had to make a minor change to the command you suggested, but now it works!

$ pip install --index-url https://pypi.prod.mypypi.us/simple/ --extra-index-url https://pypi.org/simple bidding

Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants