python 12 install jupyter时zmq.h或libzmq报错处理

pip install jupyterlab -i https://pypi.tuna.tsinghua.edu.cn/simple

python12安装jupyterlab可能会遇到zmq.h或libzmq报错问题,错误信息如下:

/tmp/tmpw_p_gzpi/build/_src/_zmq.c: 在函数'__pyx_pf_3zmq_7backend_6cython_4_zmq_6Socket_6get'中:

/tmp/tmpw_p_gzpi/build/_src/_zmq.c:11769:58: 错误:'ZMQ_THREAD_SAFE' undeclared (first use in this function); did you mean 'ZMQ_IMMEDIATE'?

__pyx_t_10 = __Pyx_PyLong_From___pyx_anon_enum(ZMQ_THREAD_SAFE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 922, __pyx_L29_error)

^~~~~~~~~~~~~~~

ZMQ_IMMEDIATE

/tmp/tmpw_p_gzpi/build/_src/_zmq.c:11769:58: 附注:每个未声明的标识符在其出现的函数内只报告一次

ninja: build stopped: subcommand failed.

直接原因是系统没安装zeromq,另外cmake、gcc版本有可能比较低。

1 升级cmake和gcc

conda install cmake

conda install gcc=12 -c conda-forge

2 安装zeromq

conda install zeromq

3 安装jupyterlab

pip install jupyterlab -i https://pypi.tuna.tsinghua.edu.cn/simple

此时,安装jupyterlab就不会报错了。

reference


相关推荐
Wellijohn4 分钟前
Python 异步并发:我把 5 个坑踩完了,你照着抄模板就行
python
AI创界者11 分钟前
Python 进阶实战(六十二章):分布式定时任务、异步工作流与幂等补偿机制实战
人工智能·python·aigc
炸薯条!2 小时前
Python面向对象基础:类与对象、实例方法、魔法方法和属性详解
java·开发语言·python
tryCbest2 小时前
Python 爬虫从入门到实战(二):进阶篇——反爬对抗、并发与动态页面
开发语言·爬虫·python
VIP_CQCRE2 小时前
GPT Image 2.6 动态表情交付别只发预览:GIF 文件校验、哈希清单与下载排错
图像处理·人工智能·python·gif
2601_967987372 小时前
使用 NumPy 和 Python 实现梯度下降
python·机器学习·线性回归·numpy·梯度下降
BD_Marathon3 小时前
Jupyter魔法命令
ide·python·jupyter
词却3 小时前
Python 正则表达式实战:使用 re 模块提取符合条件的字符串
python·正则表达式
汤姆宝库4 小时前
视觉语言模型的实现:LLaVA式投影与指令微调
python·深度学习·语言模型
2601_9679791214 小时前
初学者必知的Python中优雅的用法
python·枚举·初学者·优雅用法·字典解析