0
C:\Users\NAVEEN\Desktop\Demo>virtualenv venv

Traceback (most recent call last):
  File "c:\users\naveen\appdata\local\programs\python\python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\naveen\appdata\local\programs\python\python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\NAVEEN\AppData\Local\Programs\Python\Python38\Scripts\virtualenv.exe\__main__.py", line 4, in <module>
  File "c:\users\naveen\appdata\local\programs\python\python38\lib\site-packages\virtualenv\__init__.py", line 3, in <module>
    from .run import cli_run
  File "c:\users\naveen\appdata\local\programs\python\python38\lib\site-packages\virtualenv\run\__init__.py", line 12, in <module>
    from .plugin.activators import ActivationSelector
  File "c:\users\naveen\appdata\local\programs\python\python38\lib\site-packages\virtualenv\run\plugin\activators.py", line 6, in <module>
    from .base import ComponentBuilder
  File "c:\users\naveen\appdata\local\programs\python\python38\lib\site-packages\virtualenv\run\plugin\base.py", line 7, in <module>
    from importlib.metadata import entry_points
ModuleNotFoundError: No module named 'importlib.metadata'
Ivan Starostin
  • 8,798
  • 5
  • 21
  • 39
Naveenkumar A
  • 21
  • 1
  • 4
  • please try below commands python3 -m venv myvenv or python -m venv myvenv for more : https://tutorial.djangogirls.org/en/django_installation/ – teddcp Mar 19 '20 at 14:07
  • Wecome to Stack Overflow ! Please review the [guidelines](https://stackoverflow.com/help/how-to-ask) on how to ask questions. You will greatly improve your chances of getting good answers if your question has context and shows some efforts. – Chargaff Mar 19 '20 at 14:30
  • how did you solve this? – Mohammad Ali Mar 16 '21 at 07:56

3 Answers3

2

In Python 3.6+, the pyvenv module is deprecated.Your python interpreter version is 3.8.

Use the following one-liner instead:

python3 -m venv <myenvname>

Python already ships with its builtin "virtualenv" called venv since version 3.3. You no longer need to install or download the virtualenv scripts for Python 3.3+.

Refer the doc for more and Another stackOverflow Answer

teddcp
  • 1,514
  • 2
  • 11
  • 25
1

You want to write it like this:

python -m venv {virtualenv}

replace '{virtualenv}' with the name you want your virtual environment to have.

0

Fisrt install virtualenv Using comand pip install virtualenv Or pip3 install virtualenv(for linux) Then you can create a venv You can check version ov virtualenv using comand virtualenv --version