[Python] How to create virtual env with Python 3?

Discussão em 'Python' iniciado por Stack, Março 7, 2025.

  1. Stack

    Stack Membro Participativo

    I am using Python 2.7 + virtualenv version 1.10.1 for running myproject project. Due to some other projects requirement I have to work with another version of Python (3.5). For this I have installed Python in my user directory. Also I have downloaded and installed virtualenv (version 15.1.0) into my user directory.

    But whenever I am trying to create virtual env I am getting the below error

    python virtualenv/virtualenv.py myproject


    Using base prefix '/home/myuser/python3'
    New python executable in /home/mount/myuser/project_python3/myproject/bin/python
    ERROR: The executable /home/mount/myuser/project_python3/myproject/bin/python is not functioning
    ERROR: It thinks sys.prefix is '/home/myuser/python3' (should be '/home/mount/myuser/project_python3/myproject')
    ERROR: virtualenv is not compatible with this system or executable


    What am I doing wrong here and how do I solve it?

    Continue reading...

Compartilhe esta Página