Closed Mr-Zhen closed 3 years ago
Hi! could you provide a minimal setup to reproduce your error? Also, what python version are you using?
My python version is 3.8.1
# only one line in the py file import requests
and then run pipreqs.exe . --encoding=utf8 --debug --print --no-pin
DEBUG: Found packages: {'requests'} DEBUG: Found imports: Requests DEBUG: Getting packages information from Local/PyPI DEBUG: Starting new HTTPS connection (1): pypi.python.org:443 DEBUG: https://pypi.python.org:443 "GET /pypi/Requests/json HTTP/1.1" 301 122 DEBUG: Starting new HTTPS connection (1): pypi.org:443 DEBUG: https://pypi.org:443 "GET /pypi/Requests/json HTTP/1.1" 301 173 DEBUG: https://pypi.org:443 "GET /pypi/requests/json HTTP/1.1" 200 31330 DEBUG: Writing 2 requirements: ~equests, Requests to - ~equests Requests INFO: Successfully output requirements
Thank you for your reply! That's a really weird bug, and you don't seem to be the only one with it, issue #206 seems pretty similar. But for some reason I can't reproduce it in my machine using python 3.9. I wonder if this is something windows related and that's why I cant reproduce it. Do you have anything special in your setup besides using windows?
I am using python 3.8.1 under miniconda on Windows system. And this problem still exists after I update python to 3.9.2. Then I try pure python 3.8, pure python 3.9 and python 3.8.1 under miniconda(similar with my host) on another Windows machine. But never reproduce it. Maybe there are some conflicts between the packages I have installed?
Are you using the same version of pipreqs on both of your machines?
Maybe there are some conflicts between the packages I have installed?
Perhaps, please let me know if you find how to reproduce it :)
# the py file import requests import tqdm import certifi
DEBUG: Found packages: {'certifi', 'requests', 'tqdm'} DEBUG: Found imports: certifi, Requests, tqdm DEBUG: Getting packages information from Local/PyPI DEBUG: Starting new HTTPS connection (1): pypi.python.org:443 DEBUG: https://pypi.python.org:443 "GET /pypi/certifi/json HTTP/1.1" 301 122 DEBUG: Starting new HTTPS connection (1): pypi.org:443 DEBUG: https://pypi.org:443 "GET /pypi/certifi/json HTTP/1.1" 200 12842 DEBUG: Starting new HTTPS connection (1): pypi.python.org:443 DEBUG: https://pypi.python.org:443 "GET /pypi/Requests/json HTTP/1.1" 301 122 DEBUG: Starting new HTTPS connection (1): pypi.org:443 DEBUG: https://pypi.org:443 "GET /pypi/Requests/json HTTP/1.1" 301 173 DEBUG: https://pypi.org:443 "GET /pypi/requests/json HTTP/1.1" 200 31330 DEBUG: Starting new HTTPS connection (1): pypi.python.org:443 DEBUG: https://pypi.python.org:443 "GET /pypi/tqdm/json HTTP/1.1" 301 122 DEBUG: Starting new HTTPS connection (1): pypi.org:443 DEBUG: https://pypi.org:443 "GET /pypi/tqdm/json HTTP/1.1" 200 57637 DEBUG: Writing 6 requirements: ~qdm, ~equests, ~ertifi, certifi, Requests, tqdm to - ~qdm==4.42.1 ~equests==2.24.0 ~ertifi==2019.11.28 certifi==2020.12.5 Requests==2.25.1 tqdm==4.60.0 INFO: Successfully output requirements
I find these packages begain with "~" in the site-packages directory cause this problem. It performs normal after I delete these packages.
That is weird but I'm glad the issue is fixed. Not sure if there is something we can change in pipreqs to avoid this sort of problem since it seems to be something external. My guess is that this is miniconda's fault. I will close this issue since your main problem seems to be solved, but feel free to reopen it if I'm mistaken. Also, if you learn anything else about what caused this problem, please let me know :)
pipreqs.exe . --encoding=utf8 --debug --print --no-pin --pypi-server https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r .\requirements.txt
🤔