Distributing Scapy in a Python Virtual Environment

18 Views Asked by At

I need to distribute a package among a group of servers that are, by design, all running the same OS and version of Python. I have a CI script in Gitlab that is pretty straight forward. I'm using a custom Alma 8.8 image with Python 3.9.18 installed.

/usr/bin/python3.9 -m venv envname 
source somename/bin/activate
# i've done python3/pip3 --version to verify the version
pip3 install -r requirements.txt # <- scapy is in here
# do some cleanup
# zip up everything including the 'envname' folder

Everything gets built and packaged just fine. However when I copy the package to another machine, unzip and run it I get ModuleNotFoundError: No module named 'scapy'.

The OS and Python versions in the image in which I'm building this .zip file match those of the machine where I'm trying to run it.

When I create the virtual environment on the server and run that version it works fine. Running pip install on the server where the script will be running is not an option.

Any suggestions on what I could be overlooking? Thank you.

0

There are 0 best solutions below