I created a virtual environment, but there is no built-in library(for example xx.py) in lib, only a site-package, and Then I want to run the virtual environment in other machines after compression, what should I do?
The issue is coming from https://github.com/pypa/virtualenv/issues/2032.
If you want just copy and run functionality you might want to look into https://www.pyinstaller.org. If you can guarantee that the target machine will have the same python available then take a look at https://github.com/linkedin/shiv or https://github.com/pantsbuild/pex.
To expand on what @bernatgabor said… a virtualenv is not a self-contained package which can be copied to other machines. It refers to resources (the Python interpreter and standard library, as you noticed) which are installed on the system.
You can either use a packaging tool to convert that virtualenv into a deployable archive, or you can create the virtualenv on each target machine and install your application into it.
You’re right.It’s done.
Also thank you.