Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

默认 ExecutionPolicy 下 launcher.cmd 无法运行 #18

Closed
loveliveao opened this issue Jun 4, 2021 · 16 comments
Closed

默认 ExecutionPolicy 下 launcher.cmd 无法运行 #18

loveliveao opened this issue Jun 4, 2021 · 16 comments
Labels
bug Something isn't working

Comments

@loveliveao
Copy link

大佬好,请问下载好的文件应该放到哪个路径?
我输入py -3.8 -m pip install -r requirements.txt报错找不到文件,之后尝试在cmd里面cd到auto-derby-master所在路径再使用上面的语句会读条安装pip依赖,pip list里面也能看到opencv等依赖
现在双击launcher.cmd会闪一下命令提示符界面,但是没有GUI。
现在不知道该怎么弄了,希望大佬能指点一下我。

@NateScarlet
Copy link
Owner

项目所在路径应该不影响 不过尽量避免中文路径

启动器闪退看 launcher.log

命令找不到文件是找不到哪个文件

你是不是装python的时候选择了不安装 py 启动器

@NateScarlet
Copy link
Owner

按理来说没装 py 启动器应该不影响 launcher

我改成不存在的名称测试过

@NateScarlet
Copy link
Owner

或者是你 UAC 设置的问题

这个脚本需要管理员权限 不然游戏不认鼠标事件

@NateScarlet NateScarlet added the question Further information is requested label Jun 4, 2021
@NateScarlet
Copy link
Owner

NateScarlet commented Jun 4, 2021

启动器 windows 8 以下需要你自己更新 powershell

需求 powershell 3 以上, win8 自带 win7 要手动更新

含 powershell 5.1 的更新包

@loveliveao
Copy link
Author

刚开始找不到的文件是requirements.txt 这个问题通过cd到文件夹解决了
我在auto-derby的文件夹里面没看到有launcher.log
我电脑用的是管理员账户,平时使用的时候也不弹UAC提示。
目前用的电脑系统是Windows 10 专业工作站版 2020H2
我先去重装一下python,仔细看看是不是没勾选安装启动器

@NateScarlet
Copy link
Owner

如果你 pip 安装能装就说明装了启动器

@loveliveao
Copy link
Author

我刚刚要卸载python的时候发现了一个叫Python Launcher的软件,这个应该就是启动器了吧
刚刚说的报错如下
image

@NateScarlet
Copy link
Owner

那你在项目文件夹运行

PowerShell -Version 3 -NoProfile "auto_derby\launcher\launcher.ps1"

看下输出 这个就是 launcher.cmd 实际执行的命令

@loveliveao
Copy link
Author

大佬请过目
image

@loveliveao
Copy link
Author

loveliveao commented Jun 4, 2021

https://blog.csdn.net/larpland/article/details/101349586
刚刚和朋友一起研究这个问题,看到了这样一篇帖子。

学习react的时候,在VSCODE中使用yarn,结果报错:找了下原因,是因为PowerShell执行策略的问题。解决方法:1. 以管理员身份运行vscode;2. 执行:get-ExecutionPolicy,显示Restricted,表示状态是禁止的;3. 执行:set-ExecutionPolicy RemoteSi...

@NateScarlet
Copy link
Owner

试下

PowerShell -Version 3 -NoProfile  -ExecutionPolicy Unrestricted "auto_derby\launcher\launcher.ps1"

@loveliveao
Copy link
Author

用了那个帖子的方法之后可以用了,已经弹出GUI了。
实在不好意思,麻烦大佬了!!!万分感谢!

@NateScarlet
Copy link
Owner

如果我在命令里面写 ExecutionPolicy 有用的话这其实是个 bug

我自己本地脚本是没这个限制的 下载下来的脚本会多安全检查

@loveliveao
Copy link
Author

哦哦,原来是这样,我翻了下前面的issue都没有这个问题。可能大家都已经自己解决了w
谢谢大佬了~

@NateScarlet NateScarlet changed the title 双击launcher.cmd无法运行 默认 ExecutionPolicy 下 launcher.cmd 无法运行 Jun 4, 2021
NateScarlet added a commit that referenced this issue Jun 4, 2021
@NateScarlet NateScarlet added bug Something isn't working and removed question Further information is requested labels Jun 4, 2021
@NateScarlet
Copy link
Owner

我本地改成严格策略复现了 然后命令加这个有用 已经修了

@NateScarlet
Copy link
Owner

应该是大家都用的 git clone 脚本在本地重新写了一遍绕过了检查

而你用的是打包下载导致文件被归类为远程文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants