win11 wsl2 装 pymol
果然又遇到了一堆问题。。搞了两天。。好不容易把pymol装好了结果手贱把rosetta的build文件给rm了。。。。。。。。。。然后又重新编译又遇到了奇怪的问题于是把wsl给重启了。。结果好不容易设置好的pymol又寄了。。。。总算搞好了,记录一下万一又寄了有地方找。。
参考:
https://github.com/schrodinger/pymol-open-source/blob/master/INSTALL
https://zhuanlan.zhihu.com/p/88113746
装库:
sudo apt install python-pmw libglew-dev freeglut3-dev libpng-dev libfreetype6-dev libxml2-dev libmsgpack-dev libglm-dev mesa-utils x11-apps libxcb-xinerama0 libxcb-icccm4 libnetcdf-dev
git clone https://github.com/rcsb/mmtf-cpp.git
不要钱的源码:
git clone https://github.com/schrodinger/pymol-open-source.git
cp mmtf-cpp/include/mmtf* pymol-open-source/include/
把一个mmtf库里的头文件移到pymol文件夹里
sudo python setup.py build install --glut
正常情况下在 /pymol-open-source 输入pymol即有pymol窗口弹出
sudo vim ~/.bashrc
添加一行 export PATH=$PATH:“/usr/local/bin“ 任何目录输入pymol都可打开
一定要加--glut不然后面报错:
NotImplementedError: compile with --glut
出现这个报错就把 build 文件夹删了重新 setup
(没删build的话直接重编译几次都没啥用。。又忘了哪看来的解决办法了
如果报错:
qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb. Aborted
就使用 pyside2 代替 pyqt5:
pip install PySide2 即可
(又是来自于角落的解决方法。。https://discourse.flathub.org/t/need-help-build-pymol-cannot-run-pymol-qt-not-available/1146 )
如果报错:
Error: unable to open display :0
似乎好像是 openGL的问题,查了整个晚上什么改值为0一点用也没。。一大堆论坛里的办法根本没啥用。。又是在互联网的某个小角落里找到了解决方法。。话说还真是简单粗暴。。
管理员权限打开powershell,更新wsl并重启:
wsl --update
wsl --shutdown
wsl 重启后要改DNS
测试:xeyes glxgears 出现眼睛和齿轮说明可以使用
可以更换默认python版本
sudo update-alternatives --config python3
可以根据不同python版本编译不同版本。。