python3 types模块,Python3:ImportError:使用模块多处理中的值时,没有名为“ _ctypes”的模块...

在Ubuntu环境下,作者在从Python 2.7.5升级到3.4.0后遇到问题,无法在3.4.0中成功分配Value类型变量。错误提示为'ImportError: No module named '_ctypes'。问题源于Python 3.4安装在/usr/local/lib/python3.4,而没有覆盖原有的3.3.2版本。解决方案是安装libffi-dev并重新安装Python 3.7。
摘要由CSDN通过智能技术生成

I am using Ubuntu and have installed Python 2.7.5 and 3.4.0. In Python 2.7.5 I am able to successfully assign a variable x = Value('i', 2), but not in 3.4.0. I am getting:

Traceback (most recent call last):

File "", line 1, in

File "/usr/local/lib/python3.4/multiprocessing/context.py", line 132, in Value

from .sharedctypes import Value

File "/usr/local/lib/python3.4/multiprocessing/sharedctypes.py", line 10, in <

module>

import ctypes

File "/usr/local/lib/python3.4/ctypes/__init__.py", line 7, in

from _ctypes import Union, Structure, Array

ImportError: No module named '_ctypes'

I just updated to 3.3.2 through installing the source of 3.4.0. It installed in /usr/local/lib/python3.4.

Did I update to Python 3.4 correctly?

One thing I n

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值