Mac搭建TensorFlow环境踩过的那些坑

在Mac上搭建TensorFlow环境时遇到了sudo pip install -U numpy报错,解决方案是使用sudo pip install --ignore-installed numpy成功升级numpy。之后安装tensorflow时遇到ImportError: No module named protobuf,通过安装protobuf后发现版本不匹配问题。朋友建议升级tensorflow版本以解决protobuf与tensorflow版本不一致的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装tensorflow时,输入Pip install tensorflow后
出现错误提示,其中红色提示文字:
matplotlib 1.3.1 requires nose,which is not installed.
matplotlib 1.3.1 requires tornado,,which is not installed.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible.

大致意思是 matplotlib的1.3.1版本需要nose、tornado,另外numpy的版本1.8.0rc1不匹配。

但是 使用pip uninstall numpy卸载numpy,不成功
使用pip install -U numpy也无法升级成功

出现错误提示:

Collecting numpy

Using cached numpy-1.10.2-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whlInstalling
 collected packages: numpy
 Found existing installation: numpy 1.8.0rc1
 DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
 Uninstalling numpy-1.8.0rc1:Exception:Traceback
 (most recent call last):
 File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/basecommand.py", line 211, in main
 status = self.run(options, args)
 File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/commands/install.py", line 311, in run
 root=options.root_path,
 File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 640, in install
 requirement.uninstall(auto_confirm=True)
 File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 716, in uninstall
 paths_to_remove.remove(auto_confirm)
 File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_uninstall.py", line 125, in remove
 renames(path, new_path)
 File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/utils/__init__.py",
 line 315, in renames
shutil.move(old, new)
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
 copy2(src, real_dst)
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
 copystat(src, dst)
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
 os.chflags(dst, st.st_flags)OSError:
 [Errno 1] Operation not permitted: '/var/folders/5n/vbm997m56xg3kw67y6bccn2m0000gn/T/pip-4tcBsd-uninstall/System/Library/Frameworks/Python.framework/Versions/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值