Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/353.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用操作系统从Python安装openssl?_Python_Openssl - Fatal编程技术网

如何使用操作系统从Python安装openssl?

如何使用操作系统从Python安装openssl?,python,openssl,Python,Openssl,我需要从Python运行几个shell命令。除了下面显示的命令外,所有操作都正常 import os exec_r = os.system("apt-get install libssl-dev") 在日志中,我看到以下消息: The following additional packages will be installed: libssl-doc libssl1.1 The following NEW packages will be installed: libssl-dev

我需要从Python运行几个shell命令。除了下面显示的命令外,所有操作都正常

import os
exec_r = os.system("apt-get install libssl-dev")
在日志中,我看到以下消息:

The following additional packages will be installed:
  libssl-doc libssl1.1
The following NEW packages will be installed:
  libssl-dev libssl-doc libssl1.1
0 upgraded, 3 newly installed, 0 to remove and 9 not upgraded.
Need to get 4431 kB of archives.
After this operation, 15.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
似乎我需要将自动应答集成到shell命令中

exec_r = os.system("apt-get install libssl-dev y")
然后我得到一个错误:

E: Unable to locate package y

从apt手册您需要运行apt get-y安装libssl dev从apt手册您需要运行apt get-y安装libssl dev