python_library() # You don't need to pass in 'requirements_relpath' if the file # is called 'requirements.txt' but I added this just for explicitness python_requirements(requirements_relpath="requirements.txt") pex_binary( name="pex", dependencies=["mylib"], entry_point="myapp.py", interpreter_constraints=["CPython==3.6.15"], )