一、解决问题
“SyntaxError: Non-UTF-8 code starting with”语法错误
二、解决步骤
1、添加注释该文档的编码格式
# coding:utf-8
OR
# coding=gbk
程序黑框中出现:(路径)用作为当前目录的以上路径启动了 CMD.EXE。 UNC 路径不受支持,默认值设为 Windows 目录。
pycharm导出依赖包以及批量导入依赖包
导出命令为:pip freeze > filename.txt,其中filename可以自己定义。
在新环境下安装移植项目依赖的三方库方法为:
pip install -r filename.txt
在其他情况下,我们也可以先将所有要安装的库列在txt文件中,然后再执行pip install -r filename.txt的方式去批量安装。
成功导出,然后转移给下一个安装。快速配环境!
切换清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
根据要求论文要求
https://github.com/GTreeSoftware/Wk-supervised-Neuron-Detection-code
要求Python 3.6、pytorch、visdom等常用包,包括numpy、tqdm、time、tifffile、glob、skimage、shutil、random、scipy、matplotlib、csv、pprint。
安装环境的代码
pip install torch==1.3.1+cu92 torchvision==0.4.2+cu92 -f https://download.pytorch.org/whl/torch_stable.html
可以运行了
出现警告了
During handling of the above exception, another exception occurred:
运行代码:python -m visdom.server
2、存在情况
pip 版本太低
pip install --user --upgrade pip
三、重新搭建环境
将配置升级到3.8环境,重新安装
pip install torch==1.4.0+cu92 torchvision==0.5.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html