A
A
Andrei2013-03-06 13:32:08
Python
Andrei, 2013-03-06 13:32:08

Virtual environment and py2exe?

Greetings!
Tell me, is it possible to install py2exe in a virtual environment?
By default, when installing py2exe from binaries, python is detected from the registry. And with further use, the exe file is created incorrectly, because. the project is in a virtual environment with its packages, and py2exe uses local python packages, which naturally are not there.
Example .
There is a local python, which contains only the py2exe package. There is a virtual environment with a yaml package (for example).
When you run py2exe, the yaml package is not placed in the exe file (since it is not in the local python) and, accordingly, the exe file is not working.
Is there any other solution to this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nochkin, 2013-03-07
@nochkin

1. You can install all the necessary packages in Python, which is located from the registry.
2. You can copy the modules as local to the project (along with your code) so that py2exe can find them locally.
3. py2exe has an includes option through which additional modules can be specified. I assume that py2exe can add a search path through sys.path.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question