Getting an error in pip lock file Please help!

pipenv lock --clear
Locking [packages] dependencies…
Building requirements…
Resolving dependencies…
Locking Failed!
[====] Locking…False
ERROR:pip.subprocessor:Preparing metadata (pyproject.toml) exited with 1
[ResolutionFailure]: File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\resolver.py”, line 645, in _main
[ResolutionFailure]: resolve_packages(
[ResolutionFailure]: File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\resolver.py”, line 612, in resolve_packages
[ResolutionFailure]: results, resolver = resolve(
[ResolutionFailure]: ^^^^^^^^
[ResolutionFailure]: File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\resolver.py”, line 592, in resolve
[ResolutionFailure]: return resolve_deps(
[ResolutionFailure]: ^^^^^^^^^^^^^
[ResolutionFailure]: File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\utils\resolver.py”, line 918, in resolve_deps
[ResolutionFailure]: results, hashes, internal_resolver = actually_resolve_deps(
[ResolutionFailure]: ^^^^^^^^^^^^^^^^^^^^^^
[ResolutionFailure]: File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\utils\resolver.py”, line 691, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\utils\resolver.py”, line 448, in resolve
[ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
You can use pipenv run pip install <requirement_name> to bypass this mechanism, then run pipenv graph to inspect the versions actually installed in the virtualenv.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: metadata generation failed

Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in run_code
File "C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Scripts\pipenv.exe_main
.py", line 7, in
# when invoked as python -m pip
^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\vendor\click\core.py”, line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\cli\options.py”, line 58, in main
return super().main(*args, **kwargs, windows_expand_args=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\vendor\click\core.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\vendor\click\core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\vendor\click\core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\vendor\click\core.py”, line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\vendor\click\decorators.py”, line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\vendor\click\core.py”, line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\vendor\click\decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\cli\command.py”, line 340, in lock
do_lock(
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\routines\lock.py”, line 65, in do_lock
venv_resolve_deps(
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\utils\resolver.py”, line 859, in venv_resolve_deps
c = resolve(cmd, st, project=project)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Priyanshu.virtualenvs\Udemy_Langchain_Course-JBUhNS-P\Lib\site-packages\pipenv\utils\resolver.py”, line 728, in resolve
raise RuntimeError(“Failed to lock Pipfile.lock!”)
RuntimeError: Failed to lock Pipfile.lock!

Pipfile.lock is not being updated properly when there are any changes. Please help in rectifying this issue!!

Please read the pinned thread and format the error message like multi-line code, so that it is properly readable; and please also include an explanation of what you are trying to do and exactly how you cause this error, step by step.