Open flyinghu123 opened 3 years ago
Hi! it looks like your PYPi server is not exposing JSON summary for packages ,which pipreqs is using example: https://pypi.org/pypi/pytest/json -> 200 and JSON object https://pypi.tuna.tsinghua.edu.cn/simple/pytest/json -> 404
@flyinghu123 Can you provide a debug output from your run?
you can use:
pipreqs --encoding utf-8 --pypi-server https://mirrors.aliyun.com/pypi/simple/
it's works for me.
DEBUG: Found packages: {'flask'} DEBUG: Found imports: Flask DEBUG: Getting packages information from Local/PyPI WARNING: Import named "Flask" not found locally. Trying to resolve it at the PyPI server. DEBUG: Starting new HTTPS connection (1): mirrors.aliyun.com:443 DEBUG: https://mirrors.aliyun.com:443 "GET /pypi/simple/Flask/json HTTP/1.1" 404 2318 WARNING: Package "Flask" does not exist or network problems DEBUG: Writing 0 requirements: to /root/Python_05/requirements.txt INFO: Successfully saved requirements file in /root/Python_05/requirements.txt
how to fix the question?
you can use:
pipreqs --encoding utf-8 --pypi-server https://mirrors.aliyun.com/pypi/simple/
it's works for me.
Nope, it's not working. the mirror aliyun still don't have the pkg index
Is it possible to get this working without the JSON API? Or is there just extra information that pipreqs needs in that API response that isn't in the simple API?
How to use a custom PyPi server? I try use
pipreqs ./ --encoding=utf-8 --force --pypi-server https://pypi.tuna.tsinghua.edu.cn/simple
, but "requirements.txt" is emtpy