安装theano时候发现报错:cannot install ''numpy'.It is a distutils installed project and thus we cannot ...

本文解决Theano安装过程中遇到的Numpy版本不匹配问题,提供两种解决方案:一是手动删除旧版Numpy,二是强制更新Numpy版本。适用于Python环境下深度学习框架配置的初学者。

发现我安装theano的时候需要numpy需要1.9以上版本,而我之前自带的numpy是1.8版本,所以版本有问题。根本原因是theano需要的numpy版本不符合要求,但是numpy已经安装过了,所以无法进行直接卸载。提供两个解决方法:

解决方法1:直接找到numpy的安装目录,直接通过sudo rm 去对文件夹进行删除。(如果找不到文件夹,可以通过下面截图方式,一般都在dist-packages目录下)

方法2:(强行安装更新更高的版本)

sudo pip install numpy --ignore-installed numpy


--------------------- 
作者:lucas-nlp 
原文:https://blog.youkuaiyun.com/qq_31747765/article/details/80303366 
 

D:\Anaconda3\envs\H_GCN\lib\site-packages\scipy\__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.3 warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}" WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain` WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string. D:\Anaconda3\envs\H_GCN\lib\site-packages\theano\link\c\cmodule.py:23: DeprecationWarning: `numpy.distutils` is deprecated since NumPy 1.23.0, as a result of the deprecation of `distutils` itself. It will be removed for Python >= 3.12. For older Python versions it will remain present. It is recommended to use `setuptools < 60.0` for those Python versions. For more details, see: https://numpy.org/devdocs/reference/distutils_status_migration.html import numpy.distutils D:\Anaconda3\envs\H_GCN\lib\site-packages\theano\scalar\basic.py:2412: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar. self.ctor = getattr(np, o_type.dtype) Traceback (most recent call last): File "D:\小论文整理\CRS1.0.py", line 11, in <module> import pymc3 as pm File "D:\Anaconda3\envs\H_GCN\lib\site-packages\pymc3\__init__.py", line 23, in <module> import theano File "D:\Anaconda3\envs\H_GCN\lib\site-packages\theano\__init__.py", line 83, in <module> from theano import scalar, tensor File "D:\Anaconda3\envs\H_GCN\lib\site-packages\theano\scalar\__init__.py", line 1, in <module> from .basic import * File "D:\Anaconda3\envs\H_GCN\lib\site-packages\theano\scalar\basic.py", line 2460, in <module> convert_to_bool = Cast(bool, name="convert_to_bool") File "D:\Anaconda3\envs\H_GCN\lib\site-pack
最新发布
07-08
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值