简体   繁体   English

朋友没有安装 Python 模块是否有“解决方法”?

[英]Friend doesn't has Python module installed is there a "workaround"?

I send mir friend a Python script with the module pytube.我向 mir 朋友发送了一个带有模块 pytube 的 Python 脚本。 But he hasn't installed the package so he couldn't run the script.但是他还没有安装 package 所以他不能运行脚本。 It was not the big of a deal because easily installed pytube.这没什么大不了的,因为很容易安装 pytube。 But how can I prevent this?但是我怎样才能防止这种情况呢? So if the script/program had more than one module but my friend doesn't want to install them all how can i "compile" the program that he doesn't need to install the modules?因此,如果脚本/程序有多个模块,但我的朋友不想全部安装它们,我如何“编译”他不需要安装模块的程序? I heard about Docker is this the right way or is there another way?我听说 Docker 这是正确的方法还是有其他方法?

You can package your code or use docker indeed.您可以 package 您的代码或确实使用 docker。 Although, this costs more time then you want to spend on it probably.虽然,这花费的时间可能比你想花的更多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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