pipenv install <package> fails when PIP_EXTRA_INDEX_URL environment variable is set (from version 2021.11.23) #4881
Description
Issue description
Pipenv 2021.11.23 fails when I try to install a package using pipenv install , if the environment variable PIP_EXTRA_INDEX_URL is set. I get the same problem in both windows and the ubuntu-latest docker image.
The following works:
- "pipenv install" with the package listed in Pipfile
- unsetting PIP_EXTRA_INDEX_URL
- rolliong back to 2021.11.15
Expected result
Package installed and added to Pipfile
Actual result
Package not installed and not added to Pipfile. Error message:
´´´
Traceback (most recent call last):
File "C:\Users\IND\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\IND\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\IND\tmpenv\Scripts\pipenv.exe_main.py", line 7, in
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\vendor\click\core.py", line 1128, in call
return self.main(*args, **kwargs)
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\vendor\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\vendor\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\vendor\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\vendor\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\vendor\click\decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\vendor\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\cli\command.py", line 194, in install
do_install(
File "c:\users\ind\tmpenv\lib\site-packages\pipenv\core.py", line 2114, in do_install
index, verify_ssl=index.startswith("https:")
AttributeError: 'list' object has no attribute 'startswith'
´´´
Steps to replicate
> set PIP_EXTRA_INDEX_URL=<extra_index_url>
> python -m venv tmpenv --upgrade-deps
> tmpenv\Scripts\activate
> pip install pipenv
> pipenv install pandas
$ pipenv --support
Pipenv version: '2021.11.23'
Pipenv location: 'c:\\users\\ind\\tmpenv\\lib\\site-packages\\pipenv'
Python location: 'c:\\users\\ind\\tmpenv\\scripts\\python.exe'
Python installations found:
3.9.4
:C:\Users\IND\AppData\Local\Programs\Python\Python39\python.exe
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.9.4',
'os_name': 'nt',
'platform_machine': 'AMD64',
'platform_python_implementation': 'CPython',
'platform_release': '10',
'platform_system': 'Windows',
'platform_version': '10.0.19041',
'python_full_version': '3.9.4',
'python_version': '3.9',
'sys_platform': 'win32'}
System environment variables:
PIP_EXTRA_INDEX_URL
PROMPT
VIRTUAL_ENV
_OLD_VIRTUAL_PATH
_OLD_VIRTUAL_PROMPT
__PSLOCKDOWNPOLICY
ALLUSERSPROFILE
APPDATA
CHOCOLATEYINSTALL
COMMONPROGRAMFILES
COMMONPROGRAMFILES(X86)
COMMONPROGRAMW6432
COMPUTERNAME
COMSPEC
DRIVERDATA
HOMEDRIVE
HOMEPATH
HOMESHARE
LOCALAPPDATA
LOGONSERVER
NUMBER_OF_PROCESSORS
ONEDRIVE
OS
PATH
PATHEXT
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
PROGRAMDATA
PROGRAMFILES
PROGRAMFILES(X86)
PROGRAMW6432
PSMODULEPATH
PUBLIC
PYENV
SNOW_INVENTORY_HOME
SYSTEMDRIVE
SYSTEMROOT
TEMP
TMP
UATDATA
USERDNSDOMAIN
USERDOMAIN
USERDOMAIN_ROAMINGPROFILE
USERNAME
USERPROFILE
WINDIR
WSLENV
WT_PROFILE_ID
WT_SESSION
ZES_ENABLE_SYSMAN
PIP_SHIMS_BASE_MODULE
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED
PipenvÔÇôspecific environment variables:
DebugÔÇôspecific environment variables:
PATH
:C:\Users\IND\tmpenv\Scripts;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\IND\ExeFiles;;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\IND\.poetry\bin;C:\Users\IND\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\IND\AppData\Local\Programs\Python\Python39\;C:\Users\IND\AppData\Local\Programs\Python\Launcher\;C:\Users\IND\AppData\Local\Microsoft\WindowsApps;C:\Users\IND\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\IND\AppData\Local\Programs\Git\cmd;C:\Users\IND\AppData\Roaming\npm;C:\Users\IND\ExeFiles\azcopy_windows_amd64_10.10.0\azcopy_windows_amd64_10.10.0;C:\Users\IND\dapr;C:\Users\IND\.dapr\bin;C:\Users\IND\.dapr\bin;C:\Users\IND\Miniconda3;C:\Users\IND\Miniconda3\Library\mingw-w64\bin;C:\Users\IND\Miniconda3\Library\usr\bin;C:\Users\IND\Miniconda3\Library\bin;C:\Users\IND\Miniconda3\Scripts
VIRTUAL_ENV
:C:\Users\IND\tmpenv
Contents of Pipfile
('C:\Users\IND\Pipfile'):
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
[dev-packages]
[requires]
python_version = "3.9"