Skip to content

PermissionError on Windows #16

@fhg-isi

Description

@fhg-isi

I tried to use following command on Windows with WinPython

python -m third_party_license_file_generator -r requirements.txt -p C:\python_env\App\WinPython\python-3.11.1.amd64

and got

mixing requirements paths and Python paths together as follows:
        'requirements.txt' - 'C:\\python_env\\App\\WinPython\\python-3.11.1.amd64'

working on license summary...

handling 'requirements.txt' with 'C:\\python_env\\App\\WinPython\\python-3.11.1.amd64' ...
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\python_env\App\WinPython\python-3.11.1.amd64\Lib\site-packages\third_party_license_file_generator\__main__.py", line 185, in <module>
    SitePackages(
  File "C:\python_env\App\WinPython\python-3.11.1.amd64\Lib\site-packages\third_party_license_file_generator\site_packages.py", line 130, in __init__
    self.run()
  File "C:\python_env\App\WinPython\python-3.11.1.amd64\Lib\site-packages\third_party_license_file_generator\site_packages.py", line 370, in run
    self._read_all_module_metadatas_and_license_files()
  File "C:\python_env\App\WinPython\python-3.11.1.amd64\Lib\site-packages\third_party_license_file_generator\site_packages.py", line 236, in _read_all_module_metadatas_and_license_files
    site_packages_path = self._get_site_packages_folder()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\python_env\App\WinPython\python-3.11.1.amd64\Lib\site-packages\third_party_license_file_generator\site_packages.py", line 175, in _get_site_packages_folder
    out, err, returncode = _run_subprocess("{0} -m site".format(self._python_path))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\python_env\App\WinPython\python-3.11.1.amd64\Lib\site-packages\third_party_license_file_generator\site_packages.py", line 25, in _run_subprocess
    p = subprocess.Popen(
        ^^^^^^^^^^^^^^^^^
  File "C:\python_env\App\WinPython\python-3.11.1.amd64\Lib\subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\python_env\App\WinPython\python-3.11.1.amd64\Lib\subprocess.py", line 1493, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [WinError 5] Access is denied

=> How to resolve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions