pip install --user fancyimpute -i https://pypi.douban.com/simple
D:\ProgramData\Anaconda3;D:\ProgramData\Anaconda3\Library\mingw-w64\bin;D:\ProgramData\Anaconda3\Library\usr\bin;D:\ProgramData\Anaconda3\Library\bin;D:\ProgramData\Anaconda3\Scripts;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Graphviz\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;D:\軟件\swigwin-4.0.2\swigwin-4.0.2;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;D:\軟件\ffmpeg-4.3.2-2021-02-27-essentials_build\ffmpeg-4.3.2-2021-02-27-essentials_build\bin;C:\Users\Administrator\AppDa
ta\Roaming\Python\Python38\Scripts;C:\Users\Administrator\AppData\Roaming\Python\Python38\site-packages
WARNING: The scripts estimator_ckpt_converter.exe, import_pb_to_tensorboard.ex
e, saved_model_cli.exe, tensorboard.exe, tf_upgrade_v2.exe, tflite_convert.exe,
toco.exe and toco_from_protos.exe are installed in 'C:\Users\Administrator\AppDa
ta\Roaming\Python\Python38\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warn
ing, use --no-warn-script-location.
pip install --target=D:/ProgramData/Anaconda3/Lib/site-packages fancyimpute -i https://pypi.douban.com/simple
D:\ProgramData\Anaconda3\Lib\site-packages
pip install --target=D:/ProgramData/Anaconda3/Lib/site-packages --use-feature=2020-resolver pyqtwebengine==5.12 -i https://pypi.douban.com/simple
pip install --target=D:/ProgramData/Anaconda3/Lib/site-packages --use-feature=2020-resolver --upgrade pyqt5==5.12 -i https://pypi.douban.com/simple
#升級spyder
pip install --target=D:\ProgramData\Anaconda3\Lib\site-packages --use-feature=2020-resolver --upgrade spyder==4.2.4 -i https://pypi.douban.com/simple
ERROR: tensorflow 2.4.1 requires numpy~=1.19.2, but you'll have numpy 1.20.2 whi
ch is incompatible.
然后看下我們當前電腦中numpy的版本
C:\Users\Administrator>conda list numpy
# packages in environment at D:\ProgramData\Anaconda3:
#
# Name Version Build Channel
numpy 1.20.2 pypi_0 pypi
numpy-base 1.19.2 py38ha3acd2a_0
numpydoc 1.1.0 pyhd3eb1b0_1
然后看下我們當前電腦中tensorflow的版本
C:\Users\Administrator>conda list tensorflow
# packages in environment at D:\ProgramData\Anaconda3:
#
# Name Version Build Channel
tensorflow 2.4.1 pypi_0 pypi
tensorflow-estimator 2.4.0 pypi_0 pypi
#結果提示當前的tensorflow版本需要一個比較低版本的numpy
#這時我們要么升級tensorflow,要么降級numpy
#我們先升級tensorflow試一試
#升級 tensorflow
#先看下tensorflow都有哪些版本
pip install tensorflow==*
#看下我們電腦上裝的tensorflow是哪個版本
conda list tensorflow
#選擇一個tensorflow版本進行安裝
pip install --target=D:\ProgramData\Anaconda3\Lib\site-packages --use-feature=2020-resolver --upgrade tensorflow==2.5.0rc1 -i https://pypi.douban.com/simple
結果提示如下錯誤,有可能是因為豆瓣鏡像上沒有這個版本。
ERROR: Could not find a version that satisfies the requirement tensorflow==2.5.0
ERROR: No matching distribution found for tensorflow==2.5.0
接下來我們降級numpy
pip install --target=D:\ProgramData\Anaconda3\Lib\site-packages --use-feature=2020-resolver --upgrade numpy==1.19.2 -i https://pypi.douban.com/simple
發(fā)現(xiàn)可以安裝成功,看下現(xiàn)在電腦中的numpy變成多少了
C:\Users\Administrator>conda list numpy
# packages in environment at D:\ProgramData\Anaconda3:
#
# Name Version Build Channel
numpy 1.20.2 pypi_0 pypi
numpy-base 1.19.2 py38ha3acd2a_0
numpydoc 1.1.0 pyhd3eb1b0_1
為什么那個numpy還是1.20.2呢?如何處理
我們先卸載numpy,然后再安裝numpy
在anaconda prompt里面執(zhí)行下面的代碼
pip uninstall numpy
pip install --use-feature=2020-resolver --upgrade numpy==1.19.2 -i https://pypi.douban.com/simple
發(fā)現(xiàn)沒有錯誤提示,再看下numpy的版本
C:\Users\Administrator>conda list numpy
# packages in environment at D:\ProgramData\Anaconda3:
#
# Name Version Build Channel
numpy 1.19.5 pypi_0 pypi
numpy-base 1.19.2 py38ha3acd2a_0
numpydoc 1.1.0 pyhd3eb1b0_1
#接下來再安裝指定版本的spyder
#根據(jù)前面的經(jīng)驗,我們先卸載已經(jīng)安裝的spyder
啟動anaconda prompt 然后輸入pip uninstall spyder
然后再輸入 pip install spyder --use-feature=2020-resolver --upgrade spyder==4.2.4 -i https://pypi.douban.com/simple
然后也沒有提示出錯,spyder4.2.4 安裝成功
然后安裝fancyimpute
如果以前安裝過fancyimpute,卻沒有安裝成功,則需要先卸載一下
pip uninstall fancyimpute
然后再安裝
pip install --use-feature=2020-resolver --upgrade fancyimpute -i https://pypi.douban.com/simple
沒有錯誤提示,但是也沒有說安裝成功。
然后用import命令導入,卻出現(xiàn)錯誤提示
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-3f82472c4160> in <module>
----> 1 import fancyimpute
D:\ProgramData\Anaconda3\lib\site-packages\fancyimpute\__init__.py in <module>
2
3 from .solver import Solver
----> 4 from .nuclear_norm_minimization import NuclearNormMinimization
5 from .matrix_factorization import MatrixFactorization
6 from .iterative_svd import IterativeSVD
D:\ProgramData\Anaconda3\lib\site-packages\fancyimpute\nuclear_norm_minimization.py in <module>
11 # limitations under the License.
12
---> 13 import cvxpy
應該是numpy版本太低,那我們還需要將numpy 版本走回到新版本,汗
先關閉你打開的spyder 還有jupyter notebook(后臺),否則執(zhí)行下面的代碼會有錯誤提示
先卸載numpy 然后再安裝numpy
啟動anaconda prompt
pip uninstall numpy
卸載過程沒有出現(xiàn)錯誤提示。但是為什么卸載完成之后用conda list命令看的時候還是有numpy呢?
這應該是沒有卸載干凈,我們還需要手動將site-packages下面和numpy直接相關的三個文件夾刪掉
numpy numpydoc numpydoc-1.1.0.dist-info
刪掉之后再執(zhí)行conda list還是能看到numpy庫 pip list 看不到numpy庫
打開一個jupyter book,然后在里面輸入import numpy庫,已經(jīng)提示這個庫不存在。
然后關閉jupyter notebook執(zhí)行
pip install --use-feature=2020-resolver --upgrade numpy -i https://pypi.douban.com/simple
提示錯誤
Installing collected packages: numpy
ERROR: tensorflow 2.4.1 requires numpy~=1.19.2, but you'll have numpy 1.20.2 whi
ch is incompatible.
Successfully installed numpy-1.20.2
但是import numpy庫已經(jīng)可以正常導入了。site-packages文件夾下面多了兩個文件夾 numpy和 numpy-1.20.2.dist-info
site-packages文件夾下面有兩個和tensorflow相關的文件。分別是tensorflow和tensorflow-2.4.1.dist-info
我們換成高版本的tensorflow試試
先卸載pip uninstall tensorflow沒有錯誤提示 然后刪除site-packages文件夾下面的tensorflow和tensorflow-2.4.1.dist-info兩個文件夾
執(zhí)行pip list看不到tensorflow了
執(zhí)行conda list 也看不到tensorflow了 numpy顯示1.20.2的版本
然后我們安裝tensorflow
pip install --use-feature=2020-resolver --upgrade tensorflow -i https://pypi.douban.com/simple
發(fā)現(xiàn)tensorflow的安裝過程中為了能讓tensorflow正確安裝卸載了電腦上已經(jīng)裝好的numpy 1.20.2,重新安裝了numpy-1.19.5,具體過程如下
Installing collected packages: numpy, tensorflow
Attempting uninstall: numpy
Found existing installation: numpy 1.20.2
Uninstalling numpy-1.20.2:
Successfully uninstalled numpy-1.20.2
Successfully installed numpy-1.19.5 tensorflow-2.4.1
沒有錯誤提示成功安裝了tensorflow-2.4.1
這時發(fā)現(xiàn)site-packages文件夾下面以前的numpy-1.20.2.dist-info變成了numpy-1.19.5.dist-info
也就是numpy-1.19.5 tensorflow-2.4.1這兩個是相匹配的。
接下來重整思路看下如何安裝pip install fancyimpute








暫無數(shù)據(jù)