Reputation: 21
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'
Upvotes: 0
Views: 3143
Reputation: 1624
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
Upvotes: 2
Reputation: 65
You want to write it like this:
python -m venv {virtualenv}
replace '{virtualenv}' with the name you want your virtual environment to have.
Upvotes: 1
Reputation: 31
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
Upvotes: 0