bndr / pipreqs

pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.
Apache License 2.0
6.09k stars 381 forks source link

How to use a Custom PyPi server? #222

Open flyinghu123 opened 3 years ago

flyinghu123 commented 3 years ago

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

pkalemba commented 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?

shoou commented 2 years ago

you can use:

pipreqs --encoding utf-8 --pypi-server https://mirrors.aliyun.com/pypi/simple/

it's works for me.

dayinfinite commented 1 year ago

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?

zydmtaichi commented 1 month ago

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

kmulka-bloomberg commented 1 month ago

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?