I have created a PyCharm project containing several Python scripts, it's using virtual environment. All is set-up and it's up and running. Windows 10.
I would now like to run the same Python scripts from within Cygwin command line. Is there a way to reuse the virtual environment created by PyCharm (C:\Users\joe_doe\\.virtualenvs\prj_name
)?
I would say: no, I don't believe it is possible, and even if it were it is not worth the trouble.
Virtual environments should probably be considered as throwaway things. Use something like pip freeze > requirements.txt
to save the list of projects installed in the virtual environment. And then pip install --requirement requirements.txt
to install these projects in a new environment. It is a good habit to curate the list of requirements and one should be comfortable with deleting and recreating virtual environments on a whim without fear of losing any information.