用pip install 和 conda install 到底有什么不同,很多时候真难以说清楚,非常明确的是,安装 的位置“有时”确实不同。这次gluoncv升级就碰到了。
(1) 卸载旧的gluoncv
pip uninstall gluoncv
(2) 然后在这里把最新的gluoncv下载下来,
https://github.com/dmlc/gluon-cv
解压后切换到目录下用python setup.py install
命令进行安装(我的mxnet-cu101安装 在mx36gpu环境)
(mx36gpu) D:\mXNet\gluon-cv-master>python setup.py install
安装到最后,Processing dependencies时居然报错了,
gluoncv 0.8.0 is already the active version in easy-install.pth Installed d:\anaconda3\envs\mx36gpu\lib\site-packages\gluoncv-0.8.0-py3.6.egg Processing dependencies for gluoncv==0.8.0 error: [Errno 2] No such file or directory: 'd:\\anaconda3\\envs\\mx36gpu\\lib\\site-packages\\chardet-3.0.4.dist-info\\METADATA'
(3)用conda install 安装 chardet
然后我用pip install chardet
时,却被告知已经被安装上了
(mx36gpu) D:\mXNet\gluon-cv-master>pip install chardet Requirement already satisfied: chardet in c:\users\administrator\appdata\roaming\python\python36\site-packages (3.0.4)
回想起以前安装不少文件包时,一般都会使用 anaconda这个channel,比如
conda install -c anaconda \
所以我尝试这样安装
(mx36gpu) D:\mXNet\gluon-cv-master>conda install -c anaconda chardet Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: d:\Anaconda3\envs\mx36gpu added / updated specs: - chardet The following packages will be downloaded: package | build ---------------------------|----------------- certifi-2020.6.20 | py36_0 160 KB anaconda chardet-3.0.4 | py36_1003 215 KB anaconda ------------------------------------------------------------ Total: 375 KB The following NEW packages will be INSTALLED: chardet anaconda/win-64::chardet-3.0.4-py36_1003 The following packages will be SUPERSEDED by a higher-priority channel: ca-certificates pkgs/main --> anaconda certifi pkgs/main --> anaconda openssl pkgs/main --> anaconda Proceed ([y]/n)? y Downloading and Extracting Packages certifi-2020.6.20 | 160 KB | ######################################| 100% chardet-3.0.4 | 215 KB | ######################################| 100% Preparing transaction: done Verifying transaction: done Executing transaction: done
(4) 最后重新setup一下gluoncv,成功。大致看了下,检查了很多包的依赖关系。
(mx36gpu) D:\mXNet\gluon-cv-master>python setup.py install running install running bdist_egg running egg_info writing gluoncv.egg-info\PKG-INFO ...... gluoncv 0.8.0 is already the active version in easy-install.pth Installed d:\anaconda3\envs\mx36gpu\lib\site-packages\gluoncv-0.8.0-py3.6.egg Processing dependencies for gluoncv==0.8.0 Searching for scipy==1.5.0 Best match: scipy 1.5.0 Adding scipy 1.5.0 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for Pillow==7.1.2 Best match: Pillow 7.1.2 Adding Pillow 7.1.2 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for portalocker==1.7.0 Best match: portalocker 1.7.0 Adding portalocker 1.7.0 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for matplotlib==3.2.2 Best match: matplotlib 3.2.2 Adding matplotlib 3.2.2 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for requests==2.18.4 Best match: requests 2.18.4 Adding requests 2.18.4 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for tqdm==4.47.0 Best match: tqdm 4.47.0 Adding tqdm 4.47.0 to easy-install.pth file Installing tqdm-script.py script to d:\Anaconda3\envs\mx36gpu\Scripts Installing tqdm.exe script to d:\Anaconda3\envs\mx36gpu\Scripts Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for numpy==1.16.6 Best match: numpy 1.16.6 Adding numpy 1.16.6 to easy-install.pth file Installing f2py-script.py script to d:\Anaconda3\envs\mx36gpu\Scripts Installing f2py.exe script to d:\Anaconda3\envs\mx36gpu\Scripts Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for pywin32==228 Best match: pywin32 228 Adding pywin32 228 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for cycler==0.10.0 Best match: cycler 0.10.0 Adding cycler 0.10.0 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for python-dateutil==2.8.1 Best match: python-dateutil 2.8.1 Adding python-dateutil 2.8.1 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for pyparsing==2.4.7 Best match: pyparsing 2.4.7 Adding pyparsing 2.4.7 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for kiwisolver==1.2.0 Best match: kiwisolver 1.2.0 Adding kiwisolver 1.2.0 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for chardet==3.0.4 Best match: chardet 3.0.4 Adding chardet 3.0.4 to easy-install.pth file Installing chardetect-script.py script to d:\Anaconda3\envs\mx36gpu\Scripts Installing chardetect.exe script to d:\Anaconda3\envs\mx36gpu\Scripts Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for urllib3==1.22 Best match: urllib3 1.22 Adding urllib3 1.22 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for certifi==2020.6.20 Best match: certifi 2020.6.20 Adding certifi 2020.6.20 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for idna==2.6 Best match: idna 2.6 Adding idna 2.6 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Searching for six==1.15.0 Best match: six 1.15.0 Adding six 1.15.0 to easy-install.pth file Using d:\anaconda3\envs\mx36gpu\lib\site-packages Finished processing dependencies for gluoncv==0.8.0 (mx36gpu) D:\mXNet\gluon-cv-master>