如何在部署到Heroku时将Cargo添加到pywinpty所需的PATH中?

enyaitl3  于 2022-11-13  发布在  Go
关注(0)|答案(2)|浏览(191)

I am getting the following error on Windows:

Cargo, the Rust package manager, is not installed or is not on PATH.
remote: This package requires Rust and Cargo to compile extensions.

I've installed Rust and cargo is in the path, but the problem persists. Does anybody know why this is happening?
Error message is the same as in this post .

euoag5mw

euoag5mw1#

Heroku的stack运行在Ubuntu上。pywinpty需要Cargo,但它是communicating with Windows processes所需的库。您可能需要它用于您的本地环境,但您不需要它用于Heroku。当您部署到Heroku时,您应该尝试将pywinpty从您的requirements.txt中删除。

pzfprimi

pzfprimi2#

如果你想要一个暂时的解决方案

打开命令行提示符(cmd)并执行

path

它将显示实际的当前路径。检查它以查看是否确实不存在必需的目录。如果确实不存在,则执行

path=%path%;directory you want to add;other directory you want to add

只要打开该路径,命令提示符中就会显示该路径。如果存在,请重新启动计算机,添加到路径的操作可能在安装后延迟。

永久解决方案

对于Win10,我猜其他版本的指令并没有太大的不同。打开System properties,找到Environment Variables。在弹出的对话框中,你会看到System Variables,其中你会看到Path。选择它,单击编辑,并通过New按钮添加你需要的目录。关闭所有弹出框并重新启动(当Windows顽固时总是一个好主意;- -))

相关问题