项目场景:
跑量子蓝鲸的时候
问题描述:
出现问题:
TypeError: int() argument must be a string, a bytes-like object or a number, not '_NoValueType’
深入查下去,往上查,查到在particlea = np.random.rand(2, 2)处发现particlea的TypeError: cannot unpack non-iterable NoneType object,test_X->whale->particlea。
可以run,但调试时在particlea = np.random.rand(2, 2)处发现particlea的
TypeError: cannot unpack non-iterable NoneType object
原因分析:
因为和另一台机子一样的代码,只是numpy版本不同,于是,将numpy 1.19.4转为numpy 1.19.1
pip install numpy==1.19.1
解决方案:
执行语句pip install numpy1.19.1
将numpy 1.19.4转为numpy 1.19.1
但是还是不懂numpy1.19.4为啥不能那样生成数组。
在执行pip install numpy1.19.1还报错
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: ‘c:\development\python\lib\site-packages\~umpy\.libs\libopenblas.NOIJJG62EMASZ
I6NYURL6JBKM4EVBGM7.gfortran-win_amd64.dll’
Consider using the --user
option or check the permissions.
于是执行pip install -U pip,还是报错:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: ‘C:\Users\george\AppData\Local\Temp\pip-uninstall-vn2kypiy\pip.exe’
Consider using the --user
option or check the permissions.
看了别人的文章,https://blog.csdn.net/weixin_43939159/article/details/109165715
于是执行
python -m pip install --upgrade pip -i https://pypi.douban.com/simple --user