首页 > 解决方案 > 无法在 virtualenv 中运行 protoc

问题描述

我正在尝试用一些数据训练一个张量流预训练模型。我创建了一个虚拟环境来正确管理库的版本。但是,我无法在虚拟环境中运行“protoc”命令。它在虚拟环境之外运行良好,因为我已经将 protoc.exe 文件添加到路径中。
这是我得到的错误:

(environment_3_9_7) PS C:\Users\dipes\Desktop\Computer Vision\Computer Vision Assignment> protoc
protoc : The term 'protoc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was   
included, verify that the path is correct and try again.
At line:1 char:1
+ protoc
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (protoc:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException 

如何将 protoc.exe 添加到 virtualenv 的路径中?

标签: python-3.xtensorflowprotocol-buffers

解决方案


只需将 protoc.exe 文件粘贴到虚拟环境的 /Scripts 中即可解决我的问题。


推荐阅读