简体   繁体   English

在树莓派中安装缺少的python软件包

[英]Installing missing python package in raspberry pi

I have the following headers in Visual Studio 2017 我在Visual Studio 2017中有以下标头

import numpy as np
import h5py
import socketserver
import struct
from threading import Thread

This source code is transferred to my Raspberry Pi Stretch but unable to execute because there are missing files. 此源代码已传输到我的Raspberry Pi Stretch中,但由于缺少文件而无法执行。 I managed to fix up until h5py. 我设法解决直到h5py。 Now, I am stuck. 现在,我被困住了。 Where can I find the packages for socketserver, struct and thread? 在哪里可以找到用于socketserver,struct和thread的软件包?

I tried to do sudo apt-get install socketserver but it is not found. 我试图做sudo apt-get install socketserver,但是找不到。 Same with others 和别人一样

socketserver , struct and threading are all Python standard library modules, so since you're running a Debian based distro there is no need to install any external packages to get them. socketserverstructthreading都是Python标准库模块,因此,由于您正在运行基于Debian的发行版,因此无需安装任何外部软件包即可获取它们。

However, socketserver is a Python 3 module, hence not available in Python 2. Maybe this is the issue you're facing? 但是, socketserver是Python 3模块,因此在Python 2中不可用。也许这是您面临的问题? Which Python version are you using to run the script? 您使用哪个Python版本运行脚本?

Pasting error message would be helpful. 粘贴错误消息将很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM