-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
PkgResourcesDeprecationWarning for every command executed with pipenv #4960
Comments
@ShaiAvr Have you tried it outside of Conda with a normal python install? I notice you have |
@ShaiAvr I don't see also where you included a |
@ShaiAvr what version of
This thread also seems related: pypa/setuptools#2466 |
@matteius I tried reinstalling it at the Indeed I haven't tried creating a project. The warning was shown for the simple command
As for
|
Update:I managed to fix the error by reinstalling I created a sample project with the
And
|
Another Update:I just checked on my MacBook Pro with Anaconda installed and it seemed to work. I didn't get any warnings. This probably means the problem is happening in Windows or in Anaconda in Windows. |
I get this warning in Debian Sid Linux $ pipenv 1> /dev/null
/home/kyleg/.local/lib/python3.9/site-packages/pkg_resources/__init__.py:122: PkgResourcesDeprecationWarning: 2.8.2.dev9999-git.b-82c1373ba0b424c57e8c12cb5f6f1a7ee3829c27- is an invalid version and will not be supported in a future release
warnings.warn(
/home/kyleg/.local/lib/python3.9/site-packages/pkg_resources/__init__.py:122: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
warnings.warn( Which is funny, because neither of these warnings relate to Why is it showing warnings for other packages and how do we silence them? |
Related issue; This led to |
I don't exactly know what is going on here, but I think if the versions of things you had installed were compliant version numbers then you wouldn't get the warning. Sorry I am not more help here but I am going to take off the Windows label because I don't believe it is specific to windows. I think that @ShaiAvr has some old package as well that is violating the correct version numbering constraints and so getting a warning on Windows. Would be really helpful if there were clear steps on how to reproduce this on a new machine that isn't having the warnings show up. If the answer is install a version of something that violates the package versioning that won't be supported in the future then I think we can close this as won't fix because it was a decision in the packages we depend on to through this warning and eventually not support those version numbers. |
workaround for unix-like system users #!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
import warnings
from pkg_resources import PkgResourcesDeprecationWarning
warnings.simplefilter("ignore", category=PkgResourcesDeprecationWarning)
from pipenv import cli
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(cli()) |
Issue description
I installed pipenv using
pip install pipenv
in my condabase
environment. The installation was successful, but every command I run shows a weird warning at the start:This was from the simple command
pipenv -h
, but every command emits this warning before proceeding. The commands seem to work correctly, however. Forpipenv -h
, for example, the program displays the help message correctly after the warning.Another thing I should note is that it looks like the warning slows down pipenv. When I run
pipenv -h
, for example, it takes about a second or two to display the warning, and after that, it takes additional 1~2 seconds to display the actual help message, or run the specified command for this matter.Expected result
The commands executed by
pipenv
should not display this weird warning which seems out of nowhere. The commands shouldn't be slowed down because of this as well.Actual result
Every command executed by
pipenv
displays this warning and executes around 1~2 seconds after that.Steps to replicate
Just run any command like
pipenv -h
and see the warning. I am using Anaconda with Python 3.9.9 on Windows 11. I am not sure if any of these factors are related to the problem. As mentioned before, I installed pipenv into my(base)
conda environment by runningpip install pipenv
.$ pipenv --support
result (Notice this command also printed the warning)Pipenv version:
'2022.1.8'
Pipenv location:
'D:\\Programs\\Anaconda3\\lib\\site-packages\\pipenv'
Python location:
'D:\\Programs\\Anaconda3\\python.exe'
Python installations found:
3.9.9
:D:\Programs\Anaconda3\python.exe
3.9.9
:D:\Programs\Anaconda3\python.exe
PEP 508 Information:
System environment variables:
ALLUSERSPROFILE
APPDATA
AZ_ENABLED
COMMONPROGRAMFILES
COMMONPROGRAMFILES(X86)
COMMONPROGRAMW6432
COMPUTERNAME
COMSPEC
CONDA_DEFAULT_ENV
CONDA_EXE
CONDA_PREFIX
CONDA_PROMPT_MODIFIER
CONDA_PYTHON_EXE
CONDA_SHLVL
DRIVERDATA
GOPATH
HOMEDRIVE
HOMEPATH
INTELLIJ IDEA COMMUNITY EDITION
JAVA_HOME
LOCALAPPDATA
LOGONSERVER
MOREPATHS
NUMBER_OF_PROCESSORS
ONEDRIVE
ONEDRIVECOMMERCIAL
ONEDRIVECONSUMER
OS
PATH
PATHEXT
PIPENV_VENV_IN_PROJECT
POSH_GIT_ENABLED
POWERLINE_COMMAND
POWERSHELL_DISTRIBUTION_CHANNEL
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
PROGRAMDATA
PROGRAMFILES
PROGRAMFILES(X86)
PROGRAMW6432
PSMODULEPATH
PUBLIC
PYCHARM COMMUNITY EDITION
SYSTEMDRIVE
SYSTEMROOT
TEMP
TMP
USERDOMAIN
USERDOMAIN_ROAMINGPROFILE
USERNAME
USERPROFILE
WINDIR
WORKON_HOME
WSLENV
WT_PROFILE_ID
WT_SESSION
_CONDA_EXE
_CONDA_ROOT
PIP_SHIMS_BASE_MODULE
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_VENV_IN_PROJECT
:1
Debug–specific environment variables:
PATH
:D:\Programs\Anaconda3;D:\Programs\Anaconda3\Library\mingw-w64\bin;D:\Programs\Anaconda3\Library\usr\bin;D:\Programs\Anaconda3\Library\bin;D:\Programs\Anaconda3\Scripts;D:\Programs\Anaconda3\bin;D:\Programs\Anaconda3\condabin;C:\Program Files\PowerShell\7;D:\Programs\Anaconda3;D:\Programs\Anaconda3\Library\mingw-w64\bin;D:\Programs\Anaconda3\Library\usr\bin;D:\Programs\Anaconda3\Library\bin;D:\Programs\Anaconda3\Scripts;D:\Portable_Programs\geckodriver;D:\Portable_Programs\Go\bin;D:\dev\go-workspace\bin;D:\Programs\NASM;.;C:\Program Files (x86)\Razer\ChromaBroadcast\bin;C:\Program Files\Razer\ChromaBroadcast\bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\bin;d:\portable_programs\kotlin\kotlinc\bin;c:\program files (x86)\razer chroma sdk\bin;c:\program files\razer chroma sdk\bin;c:\program files (x86)\intel\intel(r) management engine components\icls;c:\program files\intel\intel(r) management engine components\icls;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0;c:\windows\system32\openssh;c:\program files (x86)\intel\intel(r) management engine components\dal;c:\program files\intel\intel(r) management engine components\dal;c:\program files (x86)\intel\intel(r) management engine components\ipt;c:\program files\intel\intel(r) management engine components\ipt;c:\windows\system32\config\systemprofile\appdata\local\microsoft\windowsapps;d:\programs\cmake\bin;c:\program files\nvidia corporation\nvidia nvdlisr;C:\Program Files\dotnet;D:\nodejs\npm;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\shai\AppData\Local\Microsoft\WindowsApps;C:\Users\shai\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\shai\AppData\Roaming\npm;D:\Programs\Git\cmd;C:\Users\shai\.dotnet\tools;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;D:\Programs\Calibre2;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\Portable_Programs\Gradle\gradle-7.0.2\bin;D:\.jdks\openjdk-15.0.2\bin;D:\Programs (x86)\texlive\2021\bin\win32;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D:\Programs\nodejs;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Users\shai\.cargo\bin;D:\Programs\JetBrains\IntelliJ IDEA Community Edition 2018.3\bin;D:\Programs\JetBrains\PyCharm Community Edition 2019.2\bin;C:\Users\shai\AppData\Local\GitHubDesktop\bin;C:\Users\shai\AppData\Local\Programs\oh-my-posh\bin;C:\Users\shai\AppData\Local\Programs\oh-my-posh\themes
The text was updated successfully, but these errors were encountered: