-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
poetry appears to be trying to install with the wrong version of pip #712
Comments
I realise this is the 4th issue I've filed today. Sorry for the noise, I'm trying to be helpful rather than difficult. I love the attitude of poetry (especially as compared to the attitude of Pipenv) and I want it to succeed, I'm just trying to see if I can make it work with our workflow. I'll try to delve into this issue more if I get a chance, and maybe even submit a PR or two. |
Ah, so after a little more investigation, it's clear Poetry always tries to use E.g. if I create a Dockerfile, to make my steps here clear: FROM ubuntu:xenial
RUN apt-get update && apt-get install -y python3-pip python3-venv
RUN pip3 install poetry
RUN poetry config settings.virtualenvs.create false
WORKDIR /srv
RUN poetry init --no-interaction --dependency django
RUN poetry install Then if I run it: $ docker build .
Sending build context to Docker daemon 5.632kB
Step 1/7 : FROM ubuntu:xenial
---> e13f3d529b1a
Step 2/7 : RUN apt-get update && apt-get install -y python3-pip python3-venv
---> Using cache
---> a0b412396326
Step 3/7 : RUN pip3 install poetry
---> Using cache
---> 12402aa3434a
Step 4/7 : RUN poetry config settings.virtualenvs.create false
---> Running in b7803af228b6
Removing intermediate container b7803af228b6
---> e240daca2351
Step 5/7 : WORKDIR /srv
---> Running in 10740da04d08
Removing intermediate container 10740da04d08
---> 90186dd0b6b0
Step 6/7 : RUN poetry init --no-interaction --dependency django
---> Running in bed6d4262adc
This command will guide you through creating your pyproject.toml config.
Using version ^2.1 for django
Removing intermediate container bed6d4262adc
---> 2d10b043a3b3
Step 7/7 : RUN poetry install
---> Running in 76283c0673db
Skipping virtualenv creation, as specified in config file.
[FileNotFoundError]
[Errno 2] No such file or directory: 'pip'
install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP]
The command '/bin/sh -c poetry install' returned a non-zero code: 2 |
It seems to me that a simple solution is to run |
Yes, at the moment Poetry just calls |
even I think the most reliable method would be to use the try:
from pip import main as pipmain
except ImportError:
from pip._internal import main as pipmain
pipmain("install", "mypackage") I'll try to look into this in the next couple of days if no-one else has already. |
@nottrobin wouldn't that method conflict with #621 ? If I'm understanding correctly, the intent is to be able to use a different version of python for running poetry vs the virtual environment that is created for your project. |
@uSpike ah I see what you mean. So there are 2 scenarios here that need to both be covered:
In scenario 2, I think the least surprising thing would be for the same version of Python used to run So I think it might make sense to use the method I describe for when |
@nottrobin I think your analysis makes sense. Would it be equivalent to:
where |
@uSpike yes exactly, and I suppose the same should apply to anything running outside the virtual environment - for example, I haven't looked into how poetry creates the virtual environment, but if it uses |
Poetry seems to use the |
Oh that's fine then. Of course, it's perfectly posssible that |
@sdispater, @uSpike thanks ❤️. When should this make it into a release? |
I think I'm running into similar if not the same problem. How do I install this version of Poetry to test fix (#831)? |
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. |
-vvv
option).Issue
In my system, I have both
python
andpip
, andpython3
andpip3
commands. (Installed withapt install python-pip python3-pip
).I installed poetry with
pip3 install poetry
, and you can see that it's usingpython3
as its binary:I've also configured it not to create virtualenvs, and I'm running this as root inside a
ubuntu:xenial
docker container.So now my
poetry install
errors, because it claims not to have python3.5:But:
The text was updated successfully, but these errors were encountered: