focus_ci 运行Python转换文件出现问题

1、使用python3.9安装itools失败
报错:

Collecting itools
  Using cached itools-0.77.8.tar.gz (798 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/jslo/software/anaconda3/envs/trasInput/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1wuyqa6o/itools_eb13ae27268f4dc382f32fc58e6f741a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1wuyqa6o/itools_eb13ae27268f4dc382f32fc58e6f741a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ixfuhecc                                                                                                                                                       
         cwd: /tmp/pip-install-1wuyqa6o/itools_eb13ae27268f4dc382f32fc58e6f741a/                                                                                      
    Complete output (6 lines):                                                                                                                                        
    Traceback (most recent call last):                                                                                                                                
      File "<string>", line 1, in <module>                                                                                                                            
      File "/tmp/pip-install-1wuyqa6o/itools_eb13ae27268f4dc382f32fc58e6f741a/setup.py", line 35                                                                      
        raise EnvironmentError, (popen.returncode, stderrdata)                                                                                                        
                              ^                                                                                                                                       
    SyntaxError: invalid syntax                                                                                                                                       
    ----------------------------------------                                                                                                                          
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

因为itools已经在2017年停止更新了,看到他最新的安装包的安装要求显示,要求python3.7版本。itools官网
使用conda安装python2.7版本,下载itools的离线安装包,使用命令python setup.py install安装itools。显示错误2。

修正后,安装成功。

2、

ModuleNotFoundError: No module named 'pip.download' when trying to install Python package 

解决:

Pip version should be reduced to 9.0.1 pip install pip==9.0.1

参考

3.运行molpro输出文件的python转换脚本,显示没有module gobject
使用conda安装的python2.7 pip安装gobject,显示找不到:

Collecting gobject
  Cache entry deserialization failed, entry ignored
  Could not find a version that satisfies the requirement gobject (from versions: )
No matching distribution found for gobject

查看gobject官网,显示最新版要求python3.6以上,我的是旧版本的python,但是如果装新版本的python就不能安装itools,因此需要寻找旧版本的gobject。

进一发现,这个包是itools需要的,查看itools安装文件,发现有说需要pygobject 2.0。在anaconda云网上搜索,找到了旧版本。使用如下命令安装,通过。

conda install -c ska pygobject

3、ImportError: cannot import name ipyscf_real
正常运行Python脚本的时候显示这个信息。
测试,在python模式下导入itools正常,但是在使用ipyscf_real的时候显示如上同样的信息,可能是itools安装的不正确,然后仔细看itools安装后的输出信息发现,在首行显示

[Warning] itools is not available
[WARNING] poppler headers not found, PDF indexation won't work
[WARNING] wv2 not found, DOC indexation won't work
[WARNING] libsoup not found, itools.web won't work
/home/jslo/software/anaconda3/envs/ci2/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)

使用链接中的方法卸载python中的第三方库,也就是使用python setup.py install --record record,txt命令,将所有安装的文件路径(包括可执行程序和库文件)找到,然后逐一删除。

shell批量删除文本中用字符串描述的文件

for line in `cat record.txt`
do
  rm $line
done

接下来,使用conda依次安装install.txt文件中说的需要的库。

conda install -c ska pygobject
conda install -c activisiongamescience pkg-config
conda install -c conda-forge pytz
conda install -c zeus1942 poppler //0.87.0 这个会自动安装glib 2.66.1

conda install -c fallen pygit2

conda 安装pygit2一直失败,改用apt

apt-cache search pygit2  //在这个命令的输出中寻找适合python2.0 的版本,最好是和安装要求一样的版本
sudo apt-get install python-pygit2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值