[英]Generating requirements.txt from mounted filesystem?
My Ubuntu OS had some problem so I mounted it on a recovery(temporary) OS. 我的Ubuntu操作系统有问题,因此我将其安装在恢复(临时)操作系统上。 Now I have access to all my previous files from the path
/mnt
(eg the 'home' folder will be at /mnt/home/
). 现在,我可以从
/mnt
路径访问以前的所有文件(例如,“ home”文件夹位于/mnt/home/
)。
I need to generate a requirements.txt
file of all the Python2.7 libraries installed in my previous OS. 我需要生成我以前的操作系统中安装的所有Python2.7库的
requirements.txt
文件。 If is use pip freeze
, I get the list of libraries of only the current OS. 如果使用
pip freeze
,则仅获得当前操作系统的库列表。
How do I generate the requirements.txt
from a mounted filesystem? 如何从已挂载的文件系统生成
requirements.txt
?
you can execute a chroot inside your mount point for example 例如,您可以在安装点内执行chroot
chroot /mnt
and after execute: 然后执行:
pip freeze
for show the system library you can execute: 为了显示您可以执行的系统库:
dpkg -l | grep python
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.