0%

参考博文:python打包适配xp老版本电脑最佳方案 - a_new_soul(黑格子) - 博客园

先下载[python 3.4.4](Python Release Python 3.4.4 | Python.org),单独创建一个目录,不写入PATH,避免与原有python环境冲突。

注意要下载32位版本,即Windows x86 MSI installer

假设安装在D:\Python34

1
2
3
4
5
6
7
cd Python34 # 切换到安装目录

python.exe -m pip install --upgrade pip==19.1.1 # 升级pip

python.exe -m pip install pefile==2019.4.18 # 这里需要提前安装版本匹配的pefile库

python.exe -m pip install pyinstaller==3.5 # 安装3.5版本的pyinstaller

用新安装的pyinstaller 3.5打包即可

1
2
3
cd D:\\Python34\\Scripts

pyinstaller.exe -F <py文件路径>

打包好的exe会生成在D:\Python34\Scripts\dist里。

经测试,可以在xp系统上正常运行。

image-20250616173216204

最初写论文用的是IEEE的模板,被拒了之后转投了爱思唯尔的期刊,需要换成爱思唯尔的单栏模板(cas-sc)。改好格式之后,又踩了一些坑,没办法跑去借了师兄的电脑,同样的tex代码在师兄的环境里做编译就没有问题。

1. 图片全部在正文之后解决方案

把所有\begin{figure}[]的强制浮动取消即可。

例如\begin{figure}[!t],改成\begin{figure}就解决了。

这样编译之后发现图片默认就会浮动在页面最上方,估计是强制浮动和爱思唯尔模板默认的浮动起冲突了。

2. 报错找不到cas-email.jpeg解决方案

用pdflatex编译即可。

编译引擎的问题,之前用xelatex报类似的错,换成pdflatex -> bibtex -> pdflatex -> pdflatex的recipe就解决了。

之前没有换引擎,随便找了一张图片,重命名为cas-email.jpeg,放在根目录下,也能临时解决。

CentOS7在2024年6月30日停止更新,其repo源也随之down掉了,导致我在用去年12月的方法升级gcc的时候报错:Could not resolve host: mirrorlist.centos.org; Name or service not known

运行命令如下:

1
2
yum install centos-release-scl -y 
yum install devtoolset-9 devtoolset-9-runtime -y

第一反应尝试给yum换源,找了网上几个换阿里源的方法,第一行没问题了,第二行报错找不到devtoolset-9。

为此又学了yum repo的结构,存储在/etc/yum.repos.d/下面所有的.repo里边写的都是源,enabled=1就是开着。搜了半天又发现这个devtoolset-9一般在CentOS-SCLo-scl.repo,CentOS-SCLo-scl-rh.repo这两个源里边找(这两个源就是通过第一句yum install centos-release-scl自动配置的)。

手动换一下清华源吧,把这两个文件里enabled的baseurl都打开,mirrorlist都关上,然后换成清华源的对应目录,原理如下:

1
2
3
4
5
sed -e "s|^mirrorlist=|#mirrorlist=|g" \
-e "s|^#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/版本|g" \
-e "s|^#baseurl=http://mirror.centos.org/\$contentdir/\$releasever|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/版本|g" \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo

其实就是把原来的centos.org换成tuna.tsinghua.edu.cn。

换了还不行,一看目录里根本没有devtoolset 9,只有45678,以为清华源东西不全。没想到又踩了坑,原来我用的CentOS 7.6.1810,源里就没有9,得超前几个版本才有。

换7.8.2003的源,问题解决。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# CentOS-SCLo-sclo.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information

[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.8.2003/sclo/$basearch/sclo/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-sclo-testing]
name=CentOS-7 - SCLo sclo Testing
baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/sclo/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-sclo-source]
name=CentOS-7 - SCLo sclo Sources
baseurl=http://vault.centos.org/centos/7/sclo/Source/sclo/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-sclo-debuginfo]
name=CentOS-7 - SCLo sclo Debuginfo
baseurl=http://mirrors.aliyun.com/centos-debuginfo/centos/7/sclo/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

PS: 下次要go build obfs4的时候别忘了,go build不起来也有可能是gcc的问题。

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment