shiv icon indicating copy to clipboard operation
shiv copied to clipboard

What is the right path for --site-packages?

Open Scinawa opened this issue 1 year ago • 2 comments

Dear developers,

I was wondering what is the right path to specify --site-packages. Is it the path of the virtualenvironment or the path of size-packages? Concretely, which one is correct?

  • shiv --site-packages .venv/lib/python3.11/site-packages/ --compressed -p '/usr/bin/env python3.11' -o executable-name -e path.to.main.py
  • shiv --site-packages .venv/ --compressed -p '/usr/bin/env python3.11' -o executable-name -e path.to.main.py

Thank you so much.

Scinawa avatar Feb 12 '25 01:02 Scinawa

Based on my limited experience, your first example is correct, it should be the full path to the site-packages folder.

smsearcy avatar Feb 20 '25 16:02 smsearcy

It seems to be a bug..

I'm doing this:

shiv --compressed -e myproject.cli:cli -o myproject.pyz 
-p '/usr/bin/env python3.12' --no-build-isolation 
--site-packages .venv/lib/python3.12/site-packages

But shiv is downloading packages again

Collecting python-dotenv>=0.21.0 (from pydantic-settings->myproject==4.1.0rc1)

 Downloading https://artifactory/api/pypi/python/packages/packages/5f/ed/539768cf28c661b5b068d66d96a2f155c4971a5d55684a514c1a0e0dec2f/python_dotenv-1.1.1-py3-none-any.whl (20 kB)

Building wheels for collected packages: airspeed

cvgaviao avatar Jul 15 '25 23:07 cvgaviao