简体   繁体   中英

Why does `pip freeze` result in an empty file?

I'm following the tutorial to deploy Django applications on Heroku.

In the 5th line of the code, it says pip freeze > requirements.txt but when I run it (from the venv ), the requirements.txt file is empty. It produced 6-7 dependencies with the same code before.

How can I fix this?

这可能意味着依赖项已安装在全局环境中,切换到venv,然后使用pip install <dependency>手动pip install <dependency> ,然后运行pip freeze Frozen应该输出依赖项

This answer is for posterity

  • This could be because of pip being deprecated.So upgrade pip by using
python -m pip install -–upgrade pip

Then run pip freeze > requirements.txt as usually.This should do the job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM