Search code examples
pythonpython-importpython-venvpython-packaging

Create a python venv that works on systems with no python installed


How do I setup a virtual environment in such a way that is can be used to call a python script, but doesn't need a system wide python.

My goal is it to have one folder with the python script in it and python itself in that folder as well with all the libs I need for that python script.

I've tried using pycharm to manage my venv, but the venv py charm creates needs a system wide python for the venv python to work. (I'm quite sure this is because of the pyvenv.cfg file which needs reference to a system wide python).


At the end of the day I don't care if I create the venv with pycharm or some other tool, I just want this to work. Any suggestions?



What I don't want, is to compile it to an executable.


Solution

  • The answer is simply, virtual environments are the wrong thing for this situation. Portable/ embedded Python is the correct thing. A video to that here https://www.youtube.com/watch?v=z8kgu74jERM