Python django Failed to create a virtualenv

I was trying to create a virtual env with python3. But it failed to create new. But the existing virtual env are working fine.

Traceback (most recent call last):
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\embed\via_app_data\via_app_data.py", line 82, in _get
    result = get_wheel(
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\wheels\acquire.py", line 23, in get_wheel
    wheel = from_bundle(distribution, version, for_py_version, search_dirs, app_data, do_periodic_update, env)
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\wheels\bundle.py", line 17, in from_bundle
    wheel = periodic_update(distribution, of_version, for_py_version, wheel, search_dirs, app_data, per, env)
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\wheels\periodic_update.py", line 35, in periodic_update
    handle_auto_update(distribution, for_py_version, wheel, search_dirs, app_data, env)
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\wheels\periodic_update.py", line 69, in handle_auto_update
    embed_update_log.write(u_log.to_dict())
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\app_data\via_disk_folder.py", line 154, in write
    self.file.write_text(json.dumps(content, sort_keys=True, indent=2))
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1154, in write_text
    with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\DELL\\AppData\\Local\\pypa\\virtualenv\\wheel\\3.10\\embed\\3\\pip.json'
fail

Your problem is the permission to write to the folder, which you must give to the Python interpreter Give admin access to the command line

Back to Top