无法在Python3.6上安装枚举包

时间:2018-08-08 18:22:07

标签: pip packages python-3.6

我正在尝试在MacOS High Sierra上运行FreeRTOS queues。它需要安装page软件包,而这又需要安装pytodos软件包,而这又需要安装enum软件包,但安装失败。

$ python3 page_object_test_case.py 
Traceback (most recent call last):
  File "page_object_test_case.py", line 3, in <module>
    import page
ModuleNotFoundError: No module named 'page'
$ pip3 install page
...
Successfully installed click-6.7 page-1.0.16
$ python3 page_object_test_case.py 
Traceback (most recent call last):
  File "page_object_test_case.py", line 3, in <module>
    import page
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/page/__init__.py", line 2, in <module>
    from pytodos import todo
ModuleNotFoundError: No module named 'pytodos'
$ pip3 install pytodos
Collecting pytodos
...
Collecting enum==0.4.6 (from pytodos)
  Downloading https://files.pythonhosted.org/packages/0c/4e/1ea357e7783c756bb579333c1e4a026fb331371ee771f616ffedc781e531/enum-0.4.6.tar.gz
    Complete output from command python setup.py egg_info:
    /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/version.py:1: UserWarning: Module enum was already imported from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/enum.py, but /private/var/folders/h3/1znktv0s36j1fdqcdrr0zvcw0000gn/T/pip-install-jhfn7vc3/enum is being added to sys.path
      import pkg_resources
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/h3/1znktv0s36j1fdqcdrr0zvcw0000gn/T/pip-install-jhfn7vc3/enum/setup.py", line 24, in <module>
        version = main_module.__version__
    AttributeError: module 'enum' has no attribute '__version__'

请注意,我已经尝试在Ubuntu上执行相同的操作。我不得不重复每一步。但是,enum的安装失败,并显示以下错误:

AttributeError: module 'enum' has no attribute 'IntFlag'  

我在做什么错了?

1 个答案:

答案 0 :(得分:2)

您在pip install page出了错。

您应该按照here的描述提供自己的模块page.py

pip install page引入了一些garbage and unrelated/unmaintained projects from PyPI