1.安装Anoconda,并在安装时把路径加进环境变量
2.右键“此电脑”,选择属性——高级系统设置——环境变量,在系统变量的Path中加入Anaconda的安装根目录,以及根目录下名为Scripts和Library\bin的目录。例如:C:\Anaconda;C:\Anaconda\Scripts;C:\Anaconda\Library\bin;
3.打开Anaconda Prompt,输入:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ #清华镜像
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ ##中科大镜像
conda config --set show_channel_urls yes
conda config --show channels #检查channels
- 这是将清华软件镜像站设置成第一下载选项。如果镜像站里有,下载速度会快很多。打开用户文件夹下的.condarc文件就会看见添加的镜像地址
几个镜像地址
其他几个镜像url
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
4.使用
conda update -n base -c defaults conda #更新conda版本
我的anaconda自带Python3.7下载时下载的conda是3.7版本的,没有管就这样继续了
5.
conda upgrade --all #先把所有工具包进行升级
3.输入
conda create -n python3.6 python=3.6 #创建Python3.6的环境
( conda create --name python2 python=2.7 创建名为Python2的Python2.7环境)
4.创建好之后输入:
active python3.6 #激活环境
deactivatae python3.6 #关闭环境
5.https://www.jianshu.com/p/7ebe1df808ba有一些anocda的命令
7.升级conda后出现错误
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "D:\ProgramData\Anaconda3\lib\site-packages\libarchive\ffi.py", line 55, in <module>
libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
File "D:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 442, in LoadLibrary
return self._dlltype(name)
File "D:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1062, in __call__
return func(*args, **kwargs)
File "D:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
exit_code = do_call(args, p)
File "D:\ProgramData\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "D:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main_update.py", line 20, in execute
install(args, parser, 'update')
File "D:\ProgramData\Anaconda3\lib\site-packages\conda\cli\install.py", line 116, in install
if context.use_only_tar_bz2:
File "D:\ProgramData\Anaconda3\lib\site-packages\conda\base\context.py", line 664, in use_only_tar_bz2
import conda_package_handling.api
File "D:\ProgramData\Anaconda3\lib\site-packages\conda_package_handling\api.py", line 3, in <module>
from libarchive.exception import ArchiveError as _LibarchiveArchiveError
File "D:\ProgramData\Anaconda3\lib\site-packages\libarchive\__init__.py", line 1, in <module>
from .entry import ArchiveEntry
File "D:\ProgramData\Anaconda3\lib\site-packages\libarchive\entry.py", line 6, in <module>
from . import ffi
File "D:\ProgramData\Anaconda3\lib\site-packages\libarchive\ffi.py", line 57, in <module>
raise ImportError("Failed to load libarchive library from %s - are any dependencies missing?"
ImportError: Failed to load libarchive library from %s - are any dependencies missing?Is your environment activated?
`$ D:\ProgramData\Anaconda3\Scripts\conda-script.py update conda`
environment variables:
CIO_TEST=<not set>
CLASSPATH=. ;D:\Program Files\Java\jdk1.8.0_151\lib\dt.jar;D:\Program
Files\Java\jdk1.8.0_151\lib\tools.jar
卸载重装,重装时选择just for me(不是for all users)
8.安装Dlib
https://pypi.org/project/dlib/#files Dlib19.7.0的文件
在https://github.com/coneypo/Dlib_install/blob/master/dlib-19.8.1-cp36-cp36m-win_amd64.whl上下载了dlib的whl文件,然后使用pip命令
9.配置pycharm
File ->Settings->Project Interpreter->add-Conda Environment->Existing environment
在Anaconda的envs文件夹下有自己创建的环境,选择python.exe