简体   繁体   中英

How to packaging and run python script including venvs on another computer

I'm using python pandas and write a simple script to modify .xlsx files. I want to delivery it as a package that my friends can use by one click ( maybe can add some inputs like file's directory). I want to know is there any way to do it quickly? Please.

You don't want to do it like that. Because it is conflicting the main idea of virtual environment. The other computer can have a different operating system, other packages or package versions installed, so copying the files will not work. The point of a virtual environment is to be able to replicate it everywhere you need it.

For a solution, you can use pip freeze > requirements.txt to extract your virtual enviroment libraries to txt. Then you can easily type pip install -r requirements.txt

If you want the exact environment, including system packages, on another computer, use Docker.

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