jzztf / wiki

wiki
https://jzztf.github.io
Other
1 stars 0 forks source link

Error #26

Open jzztf opened 6 years ago

jzztf commented 6 years ago

UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf in position 2: illegal multibyte sequence

打开csv文件报错, 后添加参数'rb'也不行, 再后来添加"`r', encoding='utf-8'"

import csv

filename = 'API_SP.POP.TOTL_DS2_zh_csv_v2.csv'
with open(filename) as f:
    reader = csv.reader(f)
    header_row = next(reader)
    print(header_row)
import csv

filename = 'API_SP.POP.TOTL_DS2_zh_csv_v2.csv'
with open(filename,'r', encoding='utf-8') as f:
    reader = csv.reader(f)
    header_row = next(reader)
    print(header_row)
jzztf commented 6 years ago

安装powerline for vim报错

原来设置的python环境,系统默认为3,6, vim里识别为2.7, 按照下面的issue添加python环境设置,生效 https://github.com/powerline/powerline/issues/521

jzztf commented 6 years ago

E 无法获得锁 /var/lib/dpkg/lock - open (11: 资源暂时不可用)

报错:

E: 无法打开锁文件 /var/lib/dpkg/lock - open (13: 权限不够)
E: 无法对状态列表目录加锁(/var/lib/dpkg/),请查看您是否正以 root 用户运行?

解决办法如下:

  1. ps aux | grep apt找到含有apt的进程,sudo kill PID

  2. 强制解锁

sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
jzztf commented 6 years ago

No CMAKE_CXX_COMPILER could be found

YouCompleteMe报错,./install.py编译失败

sudo apt update
sudo apt install -y build-essential

links: