简体   繁体   English

“此包不应在 Python 3 上访问”错误

[英]"This package should not be accessible on Python 3" error

I installed phenix (phenix-installer-1.17.1-3660-intel-linux-2.6-x86_64-centos6) on my CentOS 7 system according the installation guide ( https://www.phenix-online.org/documentation/install-setup-run.html ).我根据安装指南 ( https://www.phenix-online.org/documentation/install-设置运行.html )。 The original python version (/usr/bin/python) in my system is 2.7.5, but I installed anaconda3, so the output of "which python" command is "~/software/build/anaconda3/bin/python".我系统中的原始python版本(/usr/bin/python)是2.7.5,但是我安装了anaconda3,所以“which python”命令的输出是“~/software/build/anaconda3/bin/python”。

I tried to study the p9-sad tutorial and run the command "phenix.run_example p9-sad", but it gave the following error information:我试图研究p9-sad教程并运行命令“phenix.run_example p9-sad”,但它给出了以下错误信息:

Examples to be run:  p9-sad

Running PHENIX example: p9-sad  Fri Jan 17 15:04:44 CST 2020

Working directory: /home/sunyp/Documents/tutorial/PHENIX/p9-sad
Starting run now ... please wait a moment
Error processing line 1 of /home/sunyp/software/build/anaconda3/lib/python3.7/site-packages/google_auth-1.7.1-py3.6-nspkg.pth:

Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/site.py", line 168, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/importlib/util.py", line 14, in <module>
    from contextlib import contextmanager
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/contextlib.py", line 5, in <module>
    from collections import deque
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/collections/__init__.py", line 27, in <module>
    from reprlib import recursive_repr as _recursive_repr
  File "/home/sunyp/software/Phenix/phenix-1.17.1-install/phenix-1.17.1-3660/conda_base/lib/python2.7/site-packages/reprlib/__init__.py", line 7, in <module>
    raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sunyp/software/Phenix/phenix-1.17.1-install/phenix-1.17.1-3660/build/../conda_base/lib/python2.7/site-packages/site.py", line 73, in <module>
    __boot()
  File "/home/sunyp/software/Phenix/phenix-1.17.1-install/phenix-1.17.1-3660/build/../conda_base/lib/python2.7/site-packages/site.py", line 22, in __boot
    loader.load_module('site')
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/site.py", line 570, in <module>
    main()
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/site.py", line 557, in main
    known_paths = addsitepackages(known_paths)
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/site.py", line 349, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/site.py", line 207, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/site.py", line 178, in addpackage
    import traceback
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/traceback.py", line 3, in <module>
    import collections
  File "/home/sunyp/software/build/anaconda3/lib/python3.7/collections/__init__.py", line 27, in <module>
    from reprlib import recursive_repr as _recursive_repr
  File "/home/sunyp/software/Phenix/phenix-1.17.1-install/phenix-1.17.1-3660/conda_base/lib/python2.7/site-packages/reprlib/__init__.py", line 7, in <module>
    raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.

Does it mean that phenix requires python2 rather python3, but there is python3 in my system, so the error came out?是不是说phenix需要python2而不是python3,但是我的系统里有python3,所以报错了? And how to solve the problem?以及如何解决问题? Thank you in advance.先感谢您。

Regards,问候,

Yeping Sun孙叶平

Solely based on /home/sunyp/software/Phenix/phenix-1.17.1-install/phenix-1.17.1-3660/conda_base/lib/python2.7/site-packages/reprlib/__init__.py Phenix contains a Python 2.7 environment.仅基于/home/sunyp/software/Phenix/phenix-1.17.1-install/phenix-1.17.1-3660/conda_base/lib/python2.7/site-packages/reprlib/__init__.py Phenix 包含一个 Python 2.7环境。

You could maybe try running your code with /home/sunyp/software/Phenix/phenix-1.17.1-install/phenix-1.17.1-3660/conda_base/bin/python or something to use that Python interpreter, but it's hard to tell since Phenix source is not openly available.您可以尝试使用/home/sunyp/software/Phenix/phenix-1.17.1-install/phenix-1.17.1-3660/conda_base/bin/python或使用该 Python 解释器的东西运行您的代码,但很难告诉,因为 Phenix 源不是公开可用的。

Your environment probably contains path to python2.7.5 Check your PYTHONPATH您的环境可能包含 python2.7.5 的路径 检查您的PYTHONPATH

This doesn't work with Python 3 for obvious reasons.由于显而易见的原因,这不适用于 Python 3。 To remove it:要删除它:

unset PYTHONPATH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM