Windows系统
首先下载这个fork:
johnbanq/mesh at fix/MSVC_compilation (github.com)https://github.com/johnbanq/mesh/tree/fix/MSVC_compilation根据提示,先安装pyOpenGL,然后使用如下命令:
pip install --no-deps --install-option="--boost-location=<path_to_your_boost>" --verbose --no-cache-dir .
如果出现:
error: Microsoft Visual C++ 14.0 is required.
可以按照这个帖子来安装:
Microsoft Visual C++ 14.0 is required解决方法 - 知乎 (zhihu.com)https://zhuanlan.zhihu.com/p/126669852再次尝试安装psbody,如果出现:
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
安装boost:
(59条消息) Boost(1):Boost库简介及安装_翔底的博客-优快云博客_boost库https://blog.youkuaiyun.com/rangfei/article/details/122276395记得修改“--boost-location”......
PS 1:如果出现zmq错误,则运行 pip install pyzmq
Ubuntu系统
1. 激活conda虚拟环境。
conda activate probtalk
2. 下载和解压boost包。[下载网址]
tar xzvf boost_1_88_0.tar.gz
cd boost_1_88_0
3. 设置python版本=3.8,进行安装。
./bootstrap.sh ./bootstrap.sh --with-python-version=3.8
./b2
4.安装mesh库。
git clone https://gitclone.com/github.com/MPI-IS/mesh
cd mesh
BOOST_INCLUDE_DIRS=/path/to/boost make all
5. 若出现 "crypt.h:No such file or directory",则在conda下安装:
conda install --channel=conda-forge libxcrypt
export CPATH=/opt/conda/include/
参考:
[1] https://zhuanlan.zhihu.com/p/620236724
[2] crypt.h:No such file or directory 亲测_fatal error: crypt.h: no such file or directory-优快云博客