pymol安装

PyMOL是一个开源基础上的用户赞助的分子可视化系统,由薛定谔维护和分发。
1. conda 安装

# 安装conda

# 安装conda环境并激活

conda install -c schrodinger pymol-bundle
pip3 install PyQt5

##注意:远程服务器上不能启动,本地安装可以启动。

## 永久试用
# 安装路径下的  /path/to/lib/site-packages/pymol下找到licensing.py,把里面跟授权相关的代码注释掉,或者修改licensing.py文件

cp $con_env/lib/python3.8/site-packages/pymol/licensing.py $con_env/lib/python3.8/site-packages/pymol/licensing.py.bak
vim $con_env/lib/python3.8/site-packages/pymol/licensing.py
##
## Incentive PyMOL licensing helpers
##
 
import sys
import os
import threading
 
USE_DIRECTORIES = False
USE_FILENAMES = True
 
LICENCE_DIRECTORY = u'$PYMOL_PATH/licenses'
LICENCE_DIRECTORY_USER = u'~/.pymol/licenses'
LICENCE_FILENAME = u'$PYMOL_PATH/license.lic'
LICENCE_FILENAME_USER = u'~/.pymol/license.lic'
 
post_ns = {}
 
 
from os.path import expanduser
 
 
def post_license_check(msg):
    try:
        print("CRACKED", post_ns, msg)
        post_ns['callback'](msg)
    except KeyError:
        post_ns['message'] = msg
 
 
def set_post_license_check_handler(callback):
    post_ns['callback'] = callback
    try:
        callback(post_ns.pop('message'))
    except KeyError:
        pass
 
 
def get_license_search_path():
    '''Get the search path for license files'''
    path = []
 
    if USE_DIRECTORIES:
        path += [
            expanduser(LICENCE_DIRECTORY_USER),
            os.path.expandvars(LICENCE_DIRECTORY),
        ]
 
    if USE_FILENAMES:
        path += [filename for filename in [
            get_license_filename_user(),
            os.path.expandvars(LICENCE_FILENAME),
        ] if os.path.exists(filename)]
 
    # fallback on macOS: Schrodinger licenses directory (putting a license
    # file inside the app bundle is a Gatekeeper violation)
    if sys.platform == 'darwin':
        path.append(u'/Library/Application Support/Schrodinger/licenses')
 
    return os.pathsep.join(path)
 
 
def get_license_filenames():
    '''List of all license files which might get checked. Only for
    diagnostics feedback.
    '''
    import glob
    filenames = []
    for n in get_license_search_path().split(os.pathsep):
        if os.path.isfile(n):
            filenames.append(n)
        else:
            filenames.extend(glob.glob(n + os.sep + '*.lic'))
    return filenames
 
 
def get_license_filename_user():
    '''The user's license file location (existing or not)'''
    filename = os.path.expandvars(LICENCE_FILENAME_USER)
    filename = expanduser(filename)
    return filename
 
 
def install_license_key(key):
    '''Copy the given key to the user's license file and check the license'''
    licfile = get_license_filename_user()
 
    try:
        os.makedirs(os.path.dirname(licfile), 0o750)
    except OSError:
        pass
 
    try:
        os.unlink(licfile)
    except OSError:
        pass
 
    try:
        handle = open(licfile, 'wb')
    except IOError:
        print(' Warning: cannot write to "%s", using temporary file instead.' %
              licfile)
        import tempfile
        licfile = tempfile.mktemp('.lic')
        handle = open(licfile, 'wb')
 
    if not isinstance(key, bytes):
        key = key.encode("utf-8")
 
    # Unicode/UTF-8 BOM
    if key.startswith(b"\xEF\xBB\xBF"):
        key = key[3:]
 
    with handle:
        handle.write(key)
 
    return check_license_file(licfile)
 
 
def install_license_file(filename):
    '''Copy the given file to the user's home and check the license'''
    return install_license_key(open(filename, 'rb').read())
 
 
def get_site_license_key():
    '''Download and return the license key of an IP-based site license, or
    an empty string if IP not recognized or an error occured.'''
    return 'MYKEY-SKY'
    try:
        import requests
        response = requests.get('https://pymol.org/getlicfile.php')
        response.raise_for_status()
    except Exception as e:
        print('internet request failed: ' + str(e))
        return ''
    return response.json().get('key', '')
 
 
def print_info(info=None, withnotice=True):
    '''Print various license info.
 
    @param withnotice: Show the notice, which may contain the invoice number
    '''
    if info is None:
        info = get_info()
 
    if 'date' in info:
        print(' License Expiry date: %s' % (info['date']))
 
    if withnotice and 'notice' in info:
        print(' License Notice: %s' % (info['notice']))
 
    if 'days' in info:
        print(' Warning: License will expire in %s days' % (info['days']))
 
    if 'msg' in info:
        print(info['msg'])
 
 
def get_info():
    '''Get a dictionary with license metadata'''
    return {
        'notice' : 'Cracked By SKY',
        'date' : '2045-01-23 12:00:00',
        'msg' : 'Crackeds',
        'days' : '12311'
    }
    import pymol
    return pymol._cmd.check_license_file('')
 
 
def check_license_file(licfile=''):
    '''Return an empty string on successful license check, or an error message
    on failure.'''
    return ''
    if not licfile:
        licfile = get_license_search_path()
 
    # Workaround for FlexLM limitation (PYMOL-3507)
    if '@' in licfile and os.path.exists(licfile):
        with open(licfile) as handle:
            licfile = ("START_LICENSE\n" + handle.read().rstrip() +
                       "\nEND_LICENSE\n")
 
    import pymol
    print(pymol._cmd)
    msg = pymol._cmd.check_license_file(licfile)
    post_license_check(msg)
 
    # for rigimol
    os.environ['PYMOL_LICENSE_FILE'] = licfile
 
 
# check license in background
_t = threading.Thread(target=check_license_file)
_t.setDaemon(1)
_t.start()

#修改时间戳,例如 1906545600

vim /users/zhengxueming/.pymoltimestamp


# 时间戳计算
###### python3 代码#########

import time
dt = "2035-06-01 20:00:00"
timeArray = time.strptime(dt, "%Y-%m-%d %H:%M:%S")
timestamp = time.mktime(timeArray)
print(timestamp)

###### python3 代码#########

2. pymol源码安装

2.1.安装依赖

# CentOS
yum install gcc gcc-c++ kernel-devel python-devel tkinter python-pmw glew-devel freeglut-devel libpng-devel freetype-devel libxml2-devel glm-devel msgpack-devel netcdf-devel

# 错误:没有任何匹配: python-devel tkinter python-pmw
修改yum源
yum install python38-devel python38-tkinter 

yum install gcc gcc-c++ kernel-devel glew-devel freeglut-devel libpng-devel freetype-devel libxml2-devel glm-devel msgpack-devel netcdf-devel python38-devel python38-tkinter

# 安装Pmw (Python Megawidgets, 可选, 用于 GUI/插件)
git clone https://github.com/schrodinger/pmw-patched.git
cd pmw-patched

python setup.py install

#yum install python3-pyqt5 python38-pmw
#没有可用软件包 python3-pyqt5。
#没有可用软件包 python38-pmw。

# 考虑换Base
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
vim  /etc/yum.repos.d/CentOS-Base.repo

2.2 下载软件

git clone https://github.com/schrodinger/pymol-open-source.git
git clone https://github.com/rcsb/mmtf-cpp.git
mv mmtf-cpp/include/mmtf* pymol-open-source/include/
cd pymol-open-source

2. 3. 编译安装

prefix=$HOME/pymol-open-source-build

prefix=/home/zheng/pymol-open-source-build

python3 setup.py build install --home=$prefix --glut

# python3 setup.py build install --home=$prefix

#注意参考,按照官方的源码安装方法,编译成功,服务器上远程启动不了,可能是图形界面的问题。

参考:

https://pymol.org/2/

https://github.com/schrodinger/pymol-open-source

https://pymolwiki.org/index.php/Linux_Install
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是在Ubuntu上安装PyMOL的教程: 1. 首先,更新系统软件包列表并安装一些必要的依赖包。打开终端并执行以下命令: ``` sudo apt-get update -y sudo apt-get install -y git build-essential python3-dev libglew-dev \ libpng-dev libfreetype6-dev libxml2-dev \ libmsgpack-dev python3-pyqt5.qtopengl libglm-dev libnetcdf-dev ``` 2. 下载PyMOL的源代码。在终端中执行以下命令: ``` git clone https://github.com/schrodinger/pymol-open-source.git ``` 3. 切换到PyMOL源代码的目录。在终端中执行以下命令: ``` cd pymol-open-source ``` 4. 编译和安装PyMOL。在终端中执行以下命令: ``` python3 setup.py build install --home=$HOME/opt/pymol ``` 5. 将PyMOL的可执行文件路径添加到系统的环境变量中。在终端中执行以下命令: ``` echo 'export PATH=$HOME/opt/pymol/bin:$PATH' >> ~/.bashrc source ~/.bashrc ``` 6. 现在,您可以运行PyMOL了。在终端中执行以下命令: ``` pymol ``` 请注意,这是一种在Ubuntu上安装PyMOL的方法,其他Linux发行版可能有稍微不同的步骤。如果您遇到任何问题,请参考PyMOL的官方文档或寻求相应的支持。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [ubuntu 安装 最新 PyMOL [源码安装][免费]](https://blog.csdn.net/zdx1996/article/details/121656769)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [Pymol安装与问题解决](https://blog.csdn.net/weixin_33860377/article/details/116820709)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值