Python和Eel:PermissionError:[Errno 13] pyinstaller拒绝了该权限

时间:2019-08-26 09:19:38

标签: python windows pyinstaller eel

我有一个使用Eel的Python项目,得到了: PermissionError: [Errno 13] Permission denied: 'C:\\GitHub\\milano_scaner\\web'

我尝试使用官方Eel github中提到的Pyinstaller:here

这是我使用的命令:

pyinstaller --hidden-import=numpy.random.common -m eel "C:\\GitHub\\milano_scaner\\main.py" web 该脚本运行没有问题,而且指向互联网很重要。

这是我得到的完整输出:

(venv) C:\GitHub\milano_scaner>pyinstaller --hidden-import=numpy.random.common -m eel "C:\\GitHub\\milano_scaner\\main.py" web
109 INFO: PyInstaller: 3.5
109 INFO: Python: 3.7.4
109 INFO: Platform: Windows-10-10.0.17134-SP0
109 INFO: wrote C:\GitHub\milano_scaner\main.spec
109 INFO: UPX is not available.
125 INFO: Extending PYTHONPATH with paths
['C:\\GitHub\\milano_scaner',
 'C:\\GitHub\\milano_scaner',
 'C:\\GitHub\\milano_scaner']
125 INFO: checking Analysis
125 INFO: Building Analysis because Analysis-00.toc is non existent
125 INFO: Initializing module dependency graph...
140 INFO: Initializing module graph hooks...
140 INFO: Analyzing base_library.zip ...
4812 INFO: Analyzing hidden import 'numpy.random.common'
5500 INFO: Processing pre-find module path hook   distutils
7000 INFO: Processing pre-find module path hook   site
7000 INFO: site: retargeting to fake-dir 'c:\\github\\milano_scaner\\venv\\lib\\site-packages\\PyInstaller\\fake-modules'
9796 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
13390 INFO: running Analysis Analysis-00.toc
13406 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\github\milano_scaner\venv\scripts\python.exe
13437 INFO: Caching module hooks...
13468 INFO: Analyzing C:\GitHub\milano_scaner\main.py
15687 INFO: Analyzing C:\GitHub\milano_scaner\web
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\GitHub\milano_scaner\venv\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\building\build_main.py", line 844, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
    exec(code, spec_namespace)
  File "C:\GitHub\milano_scaner\main.spec", line 17, in <module>
    noarchive=False)
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\building\build_main.py", line 243, in __init__
    self.__postinit__()
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\building\build_main.py", line 445, in assemble
    priority_scripts.append(self.graph.run_script(script))
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\depend\analysis.py", line 219, in run_script
    return super(PyiModuleGraph, self).run_script(pathname, caller=caller)
  File "c:\github\milano_scaner\venv\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1384, in run_script
    with open(pathname, 'rb') as fp:
PermissionError: [Errno 13] Permission denied: 'C:\\GitHub\\milano_scaner\\web'

我试图:

  • 以管理员身份运行,但结果相同。
  • 检查文件夹的“ web”属性,但没有异常。
  • 从cmd而不是在PyCharm终端中运行命令。

谢谢您的帮助!

0 个答案:

没有答案