You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python3 -m venv testenv
source testenv/bin/activate
# install older version of scikit-learn
pip install pipreqs scikit-learn==0.20.3
mkdir testecho"import sklearn"> test/test.py
pipreqs test
cat test/requirements.txt
deactivate
Actual Output scikit_learn==0.24.2
Expected Output scikit_learn==0.20.3
This occurs because get_import_local is called with package names in the imports parameter (by way of candidates = get_pkg_names(candidates)). It tests if each import is in local. However, local is a dict where the keys are module names. This results in not finding the locally installed package and instead looking up the latest version on pypi.org.
The text was updated successfully, but these errors were encountered:
janschmid
added a commit
to janschmid/pipreqs
that referenced
this issue
Feb 14, 2022
Steps to reproduce:
Actual Output
scikit_learn==0.24.2
Expected Output
scikit_learn==0.20.3
This occurs because
get_import_local
is called with package names in theimports
parameter (by way ofcandidates = get_pkg_names(candidates)
). It tests if each import is inlocal
. However,local
is a dict where the keys are module names. This results in not finding the locally installed package and instead looking up the latest version on pypi.org.The text was updated successfully, but these errors were encountered: