这个是conda insall -h的一些命令:https://docs.conda.io/projects/conda/en/latest/commands/install.html?highlight=revision
原因:没有进入source activate XXX 环境下进行conda install /conda uninstatll
或是进行conda update
出现了以下问题:
conda uninstall torchvision
Collecting package metadata (repodata.json): done
Solving environment: -
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
但由于没仔细看,所以在运行中出现了下列多个问题。
有个办法可以直接解决,一般没问题,但如果还有问题的话,根据具体丢失的包卸载重新下载即可
参考:https://blog.csdn.net/weixin_35436966/article/details/91045470
针对以上问题,只要将conda回滚即可。
1.查询之前的更新版本,然后选择一个之前的版本(出现问题之前
conda list -r
2.输入conda install --revision
数字之后等待回滚成功后
以下是一开始没有用conda回滚,以及回滚后有部分缺失包的解决方法
问题1:Conda is broken after update. No module named
conda_package_handling``
参考:https://github.com/conda/conda/issues/8842
主要用这个链接解决:https://github.com/ContinuumIO/anaconda-issues/issues/11104#issuecomment-510285329
fundamentally, there's something wrong with libarchive. As a hack, what you could do is:
install miniconda to a separate folder. Tell it not to run conda init
activate that installation with source /path/to/new/miniconda/bin/activate
run conda install -p /path/to/broken/anaconda --force python-libarchive-c conda-package-handling libarchive
now open up a new terminal, and hopefully your old installation will work again.
问题2:ModuleNotFoundError: No module named 'libarchive'
参考:https://github.com/conda/conda/issues/8972
如上
进入anaconda3/pkg/对应的文件夹下:
ln -s libhdf5.so.103.0.0 ~/anaconda3/lib/libhdf5.so.103
问题3:ImportError: libmkl_rt.so: cannot open shared object file: No such file or directory
解决:
1:参考:https://github.com/davisking/dlib/issues/587#issuecomment-332197406
update your ~./bashrc with the – libmkl_rt.so , path.
No need to make any changes to — cd /etc/ld.so.conf.d
#LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib
#MKL
export LD_LIBRARY_PATH=/home/dhankar/anaconda2/pkgs/mkl-11.3.3-0/lib/:$LD_LIBRARY_PATH
I didnt make any changes within - cd /etc/ld.so.conf.d
Kindly note export LD_LIBRARY_PATH is as suggested by @davisking , in his very first answer above . My bad i should have read his instructions properly .
2(worked for me):参考:https://github.com/davisking/dlib/issues/587#issuecomment-392327083
pip install mkl
问题4:
AttributeError: 'dask.dataframe' has no attribute 'Series'
解决方法:
pip3 uninstall dask
pip3 install dask
问题5:
ImportError: libhdf5.so.103: cannot open shared object file: No such file or directory
如问题9
问题6:AttributeError: '_NamespacePath' object has no attribute 'sort'
解决方法:
sudo apt-get uninstall python3-pip (or python-pip)
sudo apt-get install python3-pip (or python-pip)
问题7:Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: /traits--5.1.1.dist-info/METADATA'
解决方法:https://blog.csdn.net/myourdream2/article/details/87560092
在~/anaconda3/pkgs/下相对应的包里能够找到相对应的METADATA,copy过去就可以
问题8:Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/home/test/anaconda3/lib/python3.6/site-packages/envisage-4.7.2.dist-info/METADATA'
解决方法:在~/anaconda3/pkgs/下相对应的包里能够找到相对应的METADATA,copy过去就可以
问题9:ImportError: libgfortran.so.4: cannot open shared object file: No such file or directory
参考:https://blog.csdn.net/u011208984/article/details/98660438
解决方法:
find ~ -name libgfortran.so.4.0.0
find ~ -name libgfortran.so.4
hadoop@Master:~$ find ~ -name libgfortran.so.4
find: `/home/hadoop/.cache/thumbnails': 权限不够
find: `/home/hadoop/.cache/dconf': 权限不够
/home/hadoop/anaconda3/pkgs/libgfortran-ng-7.2.0-hdf63c60_3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libgfortran.so.4
/home/hadoop/anaconda3/pkgs/libgfortran-ng-7.2.0-hdf63c60_3/lib/libgfortran.so.4
hadoop@Master:~$ find ~ -name libgfortran.so.4.0.0
find: `/home/hadoop/.cache/thumbnails': 权限不够
find: `/home/hadoop/.cache/dconf': 权限不够
/home/hadoop/anaconda3/pkgs/libgfortran-ng-7.2.0-hdf63c60_3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libgfortran.so.4.0.0
/home/hadoop/anaconda3/pkgs/libgfortran-ng-7.2.0-hdf63c60_3/lib/libgfortran.so.4.0.0
ln -s /home/hadoop/anaconda3/pkgs/libgfortran-ng-7.2.0-hdf63c60_3/lib/libgfortran.so.4.0.0 /home/hadoop/anaconda3/lib/libgfortran.so.4
问题10:AttributeError: module 'enum' has no attribute 'IntFlag'
解决:因为Python3.6没有这个属性,卸载即可
pip uninstall enum34
问题11:RemoveError: 'requests' is a dependency of conda and cannot be removed from conda's operating environment.
建议conda回滚