[英]How to check if distutils are installed and used properly?
I am using NeuroNER 我正在使用NeuroNER
Unfortunately,I have problem to run python main.py NeuroNER version: 1.0-dev 不幸的是,我在运行python main.py NeuroNER版本:1.0-dev时遇到问题
TensorFlow version: 1.10.0
Traceback (most recent call last):
File "main.py", line 250, in <module>
main()
File "main.py", line 245, in main
nn = NeuroNER(**arguments)
File "/home/milenko/NeuroNER-master/src/neuroner.py", line 256, in __init__
parameters, conf_parameters = self._load_parameters(arguments['parameters_filepath'], arguments=arguments)
File "/home/milenko/NeuroNER-master/src/neuroner.py", line 95, in _load_parameters
nested_parameters = utils.convert_configparser_to_dictionary(conf_parameters)
NameError: name 'utils' is not defined
AFter reading github issue I changed neuroner.py line to 阅读github 问题后,我将Neuroner.py行更改为
import distutils.util
but it does not help. 但这无济于事。 If I go for 如果我去
sudo apt-get install python3-distutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-distutils is already the newest version (3.6.5-3).
How to ckeck distutils package? 如何修改distutils包?
If I go for
apt-cache show distutils
N: Unable to locate package distutils
E: No packages found
But 但
apt-cache show python3-distutils
Package: python3-distutils
Architecture: all
Version: 3.6.5-3
Multi-Arch: foreign
Priority: optional
Section: python
Source: python3-stdlib-extensions
Origin: Ubuntu
ANyway import distutils is noot working. ANyway导入distutils无法正常工作。
Is there any command analogous to pip show? 有任何类似于pip show的命令吗?
You don't have an issue with distutils
. 您没有distutils
的问题。 The name to be defined is utils
. 要定义的名称是utils
。 So doing import distutils.util
will never fix that issue. 因此,执行import distutils.util
将永远无法解决该问题。
If you look at the source, there's a utils.py
module with the convert_configparser_to_dictionary
function defined. 如果您查看源代码,则有一个utils.py
模块,其中定义了convert_configparser_to_dictionary
函数。 You can see that here . 您可以在这里看到。
Try import utils
instead. 请尝试使用import utils
。 This will define the name utils
, and it should work as expected. 这将定义名称utils
,并且应该可以正常工作。 Note: I cannot test this. 注意:我无法测试。
HTH. HTH。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.