gpt4 book ai didi

python - ImportError:在setup.py中使用setuptools时,libSM.so.6

转载 作者:行者123 更新时间:2023-12-02 16:54:35 25 4
gpt4 key购买 nike

我不明白自己在做什么错,尝试导入cv2时出现以下错误:

  /mnt/jenkins/workspace/project/client/py3env/lib/python3.5/site-packages/opencv_
python-3.4.0.12-py3.5-linuxx86_64.egg/cv2/__init__.py"()

7
8 # make IDE's (PyCharm) autocompletion happy
---->9 from .cv2 import *
10

ImportError: libSM.so.6: cannot open shared object file: No such
file or directory

我正在使用setuptool,而我的setup.py看起来像这样:
setup(
name="Modulename",
version="0.1.0",
packages=find_packages(),
install_requires=["numpy", "matplotlib", "tqdm", "opencv-python"],
)

在我的requirements.txt文件中,我有:
   opencv-python == 3.4.0.12
numpy == 1.14.2
matplotlib == 2.2.2

在同一主题上有问题,但可以通过以下方法解决问题
apt update && apt install -y libsm6 libxext6

对我来说,当使用setup.py时,导入cv2在终端中工作,并且在Pycharm中本地工作,但不能通过Jenkins。
任何帮助都将受到欢迎!

最佳答案

使用opencv-python-headless软件包而不是opencv-python。这是出于libSM6依赖性。
pip install opencv-python-headless

关于python - ImportError:在setup.py中使用setuptools时,libSM.so.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49983013/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com