运行python时,无法识别自己写的包
在Linux端运行
export PYTHONPATH=/项目所在路径
os.mkdir()报错:FileNotFoundError: No such file or directory
os.mkdir() 只能创建单级目录,要创建多级目录需要用 os.makedirs()
同样地,单级目录也不能用 os.makedirs() 来创建
安装conda
wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod 777 Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh
是否初始化选no
vim .bashrc
输入环境变量
export PATH="/root/miniconda3/bin:"$PATH
source ~/.bashrc
使文件生效
清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --set show_channel_urls yes
conda config --get channels
默认源
conda config --remove-key channels
路径
./ 当前目录。
../ 父级目录。
/ 根目录。
Linux终端不显示图片
添加保存图片的代码
matplotlib
plt.savefig('/root/test.png')
plotly
import plotly.io as pio
pio.write_image(fig, '1.png')
bash: $‘\343\200\200’: command not found
配置环境后边多出空格