Might not be relevant, if am misunderstanding something, but I generally just use pip freeze > requirements.txt, shift that text file over to new location/machine, create new virtual environment, and run pip install -r requirements.txt from there to recreate environment, and, I do this across different operating systems as well?

Jacob Kruger
Skype: BlindZA
"Resistance is futile...but, acceptance is versatile..."
On 2024/12/10 07:33, Glyph wrote:
Hi Ilya,

The main solution here is "don't do that".  You can build binary wheels and share 
them between machines, but venvs are not meant to be shared.  I just posted about this the 
other day: <https://mastodon.social/@glyph/113608175894598083>.

Wny are you trying to copy a venv from one machine to another?

-g

On Dec 9, 2024, at 4:03 PM, Ilya Kazakevich via python-win32 
<python-win32@python.org> wrote:

Hello,

I create an environment on one Windows machine and then move it to another one.
Once I call `pip install` it creates `.exe` files for tools i.e
`poetry.exe`, `django-admin.exe` e.t.c.
This is done by a class called `ScriptMaker` as I see.
The problem is it sets a full path (`sys.executable`) so I can't move
it to another machine or directory.

To fix it I can use relative path
```
ScriptMaker.executable = "../python.exe"
```
for example, but how can I "patch" the pip?
I can put this code into `sitecustomize.py` but it looks like a hack.

Any suggestions on how to fix it in a proper way?

Thank you in advance,

Ilya.
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to