简体   繁体   English

在没有安装依赖项的情况下运行Python脚本

[英]Run Python Script Without Dependencies Installed

I am creating a Python application that uses multiple third party libraries. 我正在创建一个使用多个第三方库的Python应用程序。 Since the libraries are installed on my computer, the script runs fine. 由于这些库已安装在我的计算机上,因此脚本可以正常运行。 However, how can I alter my script so that it will run on any computer (all major OS), even if the computer does not have the third party Python libraries installed? 但是,如何更改脚本以使其可以在任何计算机(所有主要操作系统)上运行,即使该计算机未安装第三方Python库也是如此?

By your comment: 根据您的评论:

I want the script to stay a python script if at all possible so that it can be run on any device and run through a webpage 我希望脚本尽可能保留python脚本,以便它可以在任何设备上运行并通过网页运行

It appears you want some way to host a python program online. 看来您想以某种方式在线托管python程序。

To do this, you need: 为此,您需要:

  1. To know how to write Python that serves a website (see Django , Flask , CherryPy , etc...) 要知道如何编写为网站提供服务的Python(请参阅DjangoFlaskCherryPy等)

  2. Some way to deploy said application to the web. 将上述应用程序部署到Web的某种方式。 An easy, free (<-- this is the keyword) way to deploy Python web apps is through using Heroku or some other free hosting site. 部署Python Web应用程序的一种简单,免费(<-这是关键字)的方法是通过使用Heroku或其他一些免费托管站点。 Or you could always pay for hosting or host it yourself. 或者,您可以随时为托管付费,也可以自己托管。

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

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