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