python报错
问题一:
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
centos的服务器可以执行:
yum install mesa-libGL
问题二:
TypeError: FormatCode() got an unexpected keyword argument ‘verify’
Yapf 版本问题,不能是0.42.2 要降低版本
pip install yapf==0.40.1
问题三:
测试的时候cuda out of memory
问题四:
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
- conda config --remove-key channels
- conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes - conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes - 删除.condarc下的default
model.eval()
with torch.no_grad():
model(data)
按照上述结构如果还是有问题,加上下面代码,清除缓存
torch.cuda.empty_cache()
问题五:
路径问题:
import sys
sys.path.append(os.path.join(os.path.dirname(__file__)))
print(sys.path)
通过sys.path查看,这里需要添加的路径是找不到包的目录
其他
问题一:
win添加右键以vscode打开文件夹:
重新安装vscode即可,不需要卸载,在安装时勾选右键打开
问题二:
obsidian修改页面宽距:
在themes.css中搜索:
file-line-width
设置想要设置的值
问题三:
mysql启动问题
在环境变量的path中新建
C:\Program Files\MySQL\MySQL Server 8.0\bin
Win + R 执行 Cmd 的时候 按住 Ctrl Shift + Enter,以管理员的身份使用CMD
输入:
mysql -u root -p
并输入密码,便可以使用
问题四:
jdk21没有jre
使用管理员的身份打开cmd,
cd 到jdk文件下
执行:
bin\jlink.exe --module-path jmods --add-modules java.desktop --output jre
问题五:
java.lang.IllegalArgumentException: Request header is too large
修改tomcat的conf目录下的server.xml文件。
<Connector port="8080" maxHttpHeaderSize="65536" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
maxParameterCount="1000"
/>
重点是maxHttpHeaderSize=“65536”
问题六:
springsecurity login过慢和显示不出css:
学术资源加速
问题七:
可以使用xshell连接服务器,但是不能使用vscode连接
C:\Users\user.ssh 下的 known_hosts 文件移动到别的位置(治标不治本,但是能连接了)
问题八:
vscode终端不显示环境变量
以管理员的身份运行PowerShell,执行:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
选择 y 即可
问题九:
clear出错:
在~/.bashrc中添加 alias clear=‘/usr/bin/clear’
问题10:
version `GLIBCXX_3.4.29’ not found
解决方案:降低或升级对应包的版本
问题11:
pip报错:bad interpreter: No such file or directory:
修改虚拟环境的pip中的python地址,地址有误
…持续更新