pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.46k stars 3k forks source link

Wrong warning: "looks like a filename, but the file does not exist" #4019

Closed Tset-Noitamotua closed 6 years ago

Tset-Noitamotua commented 7 years ago
OS Name:                            Microsoft Windows 7 Enterprise
OS Version:                         6.1.7601 Service Pack 1 Build 7601

Description:

I have a requirements.txt with this content:

# Needed for ATOM editor to work with and display Python code correctly.
autopep8==1.2.4
flake8==3.0.4
jedi==0.9.0
mccabe==0.5.2
pep8==1.7.0
pycodestyle==2.0.0
pyflakes==1.2.3
yapf==0.13.0

# PyRFC
C:/PyRFC_sap_nwrfc_64bit/pyrfc-1.9.4-cp35-none-win_amd64.whl

I want to do pip freeze -r requirements.txt. When I do it I get a false warning Requirement 'C:/PyRFC_sap_nwrfc_64bit/pyrfc-1.9.4-cp35-none-win_amd64.whl' looks like a filename, but the file does not exist

I know that that warning is wrong because the file is there and actually I get the same result (but without warning) when I replace the / (slash) in C:/PyRFC_sap_nwrfc_64bit/pyrfc-1.9.4-cp35-none-win_amd64.whl with \ (back-slash) --> C:\PyRFC_sap_nwrfc_32bit\pyrfc-1.9.4-cp35-none-win_amd64.whl

What I've run:

> pip freeze -r requirements.txt
# Needed for ATOM editor to work with and display Python code correctly.
autopep8==1.2.4
flake8==3.0.4
jedi==0.9.0
mccabe==0.5.2
pep8==1.7.0
pycodestyle==2.0.0
pyflakes==1.2.3
yapf==0.13.0

# PyRFC
Requirement 'C:/PyRFC_sap_nwrfc_64bit/pyrfc-1.9.4-cp35-none-win_amd64.whl' looks like a filename, but the file does not exist
pyrfc==1.9.4

Same result without warning after replacing / with \

pip freeze -r requirements.txt
# Needed for ATOM editor to work with and display Python code correctly.
autopep8==1.2.4
flake8==3.0.4
jedi==0.9.0
mccabe==0.5.2
pep8==1.7.0
pycodestyle==2.0.0
pyflakes==1.2.3
yapf==0.13.0

# PyRFC
pyrfc==1.9.4
xavfernandez commented 7 years ago

It looks like you end up here: https://github.com/pypa/pip/blob/8.1.2/pip/req/req_install.py#L197-L201 Which would mean that os.path.isfile(p) returns False. Could you check the value of p ?

Tset-Noitamotua commented 7 years ago

Do you mean like that:

>>> os.path.isfile('C:\PyRFC_sap_nwrfc_64bit\pyrfc-1.9.4-cp35-none-win_amd64.whl')
True

?

dstufft commented 7 years ago

He means dropping a print(p) into that section of the code and seeing what the value of p is there to see what it's checking if it is a file exactly.

pradyunsg commented 6 years ago

Hey! It seems like it's been a while since this issue was active.

Could someone try reproducing this on the current master?

Thanks and sorry for the wait.

pradyunsg commented 6 years ago

Closing due to a lack of a response.

lock[bot] commented 5 years ago

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