Table of contents
一、ImportError: No module named ' tensorflow '
二、AttributeError: 'version_info' object has no attribute '__version__'。
三、ModuleNotFoundError: No module named 'numpy.testing.decorators'
Description: Github address of HyTE model:
GitHub - malllabiisc/HyTE: EMNLP 2018: HyTE: Hyperplane-based Temporally aware Knowledge Graph Embedding EMNLP 2018: HyTE: Hyperplane-based Temporally aware Knowledge Graph Embedding - GitHub - malllabiisc/HyTE: EMNLP 2018: H yTE: Hyperplane-based Temporally aware Knowledge Graph Embedding https://github.com/malllabiisc/HyTE It is best to use conda to create a virtual environment to reproduce the HyTE model. In addition, when reproducing, you first need to follow the instructions in the readme at the above address to operate. When you encounter a problem, check this article again to see if you can solve the problem you encountered.
一、ImportError: No module named ' tensorflow '
Cause: python version and tensorflow version are not compatible
Solution: Do not repeatedly install the tensorflowpython version, and lower the pythob version to below 3.6
conda install python=3.6
二、AttributeError: 'version_info' object has no attribute '__version__'。
As shown below:
Solution:
Find the file:
C:\Users\你的用户名\AppData\Roaming\Python\Python36\site-packages\pyparsing\__init__.py
Change the code snippet below:
class version_info(NamedTuple):
major: int
minor: int
micro: int
releaselevel: str
serial: int
for:
class version_info():
def __init__(self,major:int,minor:int,micro:int,releaselevel:str,serial:int):
self.major = major
self.minor = minor
self.micro = micro
self.releaselevel = releaselevel
self.serial = serial
三、ModuleNotFoundError: No module named 'numpy.testing.decorators'
As shown below:
Solution steps:
(a) Uninstall the original numpy
Execute the command multiple times:
pip uninstall numpy
Until all versions are uninstalled (that is, the command WARNING: Skipping numpy as it is not installed. appears):
(b) Install numpy
pip3 install numpy==1.16.4
Note that you must install a version below numpy==1.17.0, otherwise the following warning will be reported:
FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
As shown below:
Of course, there is another solution to this problem in the third section, you can refer to the following blog:
四、UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 423: illegal multibyte sequence
Solution: Add encoding="utf-8" to the file operation in time_proj.py
appendix
Problems that may also be encountered when installing numpy:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mkl-random 1.0.1 requires cython, which is not installed.
Execute the following command:
pip install --upgrade setuptools
pip install mkl-random
As shown below: