3

I am on Windows 10, Python 3.10.2. Here are the commands that I ran to create the virtual environment:

Here are my versions for packages:

virtualenv==16.7.5
virtualenvwrapper-win==1.2.6
  1. I installed the virtual environment.
D:\voice-cloning\real-time-voice-cloning>python -m pip install virtualenv
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (d:\python\lib\site-packages)
Requirement already satisfied: virtualenv in d:\python\lib\site-packages (16.7.5)
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (d:\python\lib\site-packages)
WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
You should consider upgrading via the 'D:\python\python.exe -m pip install --upgrade pip' command.

Then I ran these commands:

D:\voice-cloning\real-time-voice-cloning>python -m virtualenv venv310
D:\python\lib\site-packages\virtualenv.py:24: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.spawn
D:\python\lib\site-packages\virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
Using base prefix 'D:\\python'
New python executable in D:\voice-cloning\real-time-voice-cloning\venv310\Scripts\python.exe
Traceback (most recent call last):
  File "D:\python\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\python\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\python\lib\site-packages\virtualenv.py", line 2632, in <module>
    main()
  File "D:\python\lib\site-packages\virtualenv.py", line 860, in main
    create_environment(
  File "D:\python\lib\site-packages\virtualenv.py", line 1156, in create_environment
    install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
  File "D:\python\lib\site-packages\virtualenv.py", line 1719, in install_python
    fix_local_scheme(home_dir, symlink)
  File "D:\python\lib\site-packages\virtualenv.py", line 1805, in fix_local_scheme
    if sysconfig._get_default_scheme() == "posix_local":
AttributeError: module 'sysconfig' has no attribute '_get_default_scheme'. Did you mean: 'get_default_scheme'?

Here are the commands I ran for activating the virtual environment and none of them worked:

D:\voice-cloning\real-time-voice-cloning>venv310/scripts/activate
'venv310' is not recognized as an internal or external command,
operable program or batch file.

D:\voice-cloning\real-time-voice-cloning>python venv310/scripts/activate
python: can't open file 'D:\\voice-cloning\\real-time-voice-cloning\\venv310\\scripts\\activate': [Errno 2] No such file or directory

D:\voice-cloning\real-time-voice-cloning>venv310/Scripts/activate
'venv310' is not recognized as an internal or external command,
operable program or batch file.

D:\voice-cloning\real-time-voice-cloning>activate
'activate' is not recognized as an internal or external command,
operable program or batch file.

D:\voice-cloning\real-time-voice-cloning>cd venv310

D:\voice-cloning\real-time-voice-cloning\venv310>.\Scripts\activate
'.\Scripts\activate' is not recognized as an internal or external command,
operable program or batch file.

What is missing here?

Thanks.

7
  • 1
    Looks like the creation of venv was stalled due to an error. It is really hard to guess what went wrong by just looking at your question. Please provide you python version and ways to reproduce your error. Mar 18, 2022 at 5:21
  • Please read the VENV manual. Do you wish to activate an existing or create a new venv?
    – s0mbre
    Mar 18, 2022 at 5:22
  • @NikhilDevadiga My Python version is 3.10.2. I am adding a bit more information to the question. :)
    – Real Noob
    Mar 18, 2022 at 5:23
  • 1
    Please also add the virtualenv version. You can get this by typing this out in the terminal pip freeze Mar 18, 2022 at 5:29
  • Thanks for the clear instructions @NikhilDevadiga :). I have added the version information for virtualenv and virtualenvwrapper-win.
    – Real Noob
    Mar 18, 2022 at 5:42

2 Answers 2

7

Using python 3.10.2 and virtualenv 16.7.5 gives me the same error. Looks like virtualenv 16.7.5 is too old for 3.10.2. Upgrade you package with this command and everything will work out.

pip install --upgrade virtualenv
4
  • Hi Nikhil. How did you test it out so quickly on your system?
    – Real Noob
    Mar 18, 2022 at 8:20
  • I mean did you already have Python 3.10.2 installed?
    – Real Noob
    Mar 18, 2022 at 8:20
  • 1
    Yes. I had python 3.10.2 and the latest virtualenv which I have been using for a couple of months now so I knew this works. I just guessed that you have an older version of virtualenv which doesn't work. Quickly executing couple of commands pip install --upgrade virutalenv==16.7.5 python -m virtualenv venv and I could reproduce your error :^) Mar 18, 2022 at 9:56
  • by far the best solution, before that i had done sudo apt-get install python3.9-distutils, sudo apt-get install python3.10-distutils with no luck
    – cubanguy
    Jul 17, 2022 at 7:17
0

Make sure that in the windows PATH variable there is an entry with your python installation and the scripts subfolder eg: C:\Program Files (x86)\Python36-32\ and C:\Program Files (x86)\Python36-32\Scripts
When using pip install virtualenv, make sure that you run cmd as administrator. Otherwise, there might an access denied error during installation and virtualenv will not be installed properly. Make sure that virtualenv has been installed correctly. Check in the python scripts subfolder - there must exist an .exe named virtualenv.exe. If not, uninstall will pip uninstall virtualenv and install again.

1
  • Thanks Inshaal. I will try them and let you know. :)
    – Real Noob
    Mar 18, 2022 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.