Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?

前端 未结 17 1080
无人共我
无人共我 2020-11-22 16:34

I just installed Python 3.6.1 for MacOS X

When I attempt to run the Console(or run anything with Python3), this error is thrown:

  AttributeError: mo         


        
17条回答
  •  感情败类
    2020-11-22 17:06

    If anyone is having this problem when trying to run Jupyter kernel from a virtualenv, just add correct PYTHONPATH to kernel.json of your virtualenv kernel (Python 3 in example):

    {
     "argv": [
      "/usr/local/Cellar/python/3.6.5/bin/python3.6",
      "-m",
      "ipykernel_launcher",
      "-f",
      "{connection_file}"
     ],
     "display_name": "Python 3 (TensorFlow)",
     "language": "python",
     "env": {
         "PYTHONPATH":     "/Users/dimitrijer/git/mlai/.venv/lib/python3.6:/Users/dimitrijer/git/mlai/.venv/lib/python3.6/lib-dynload:/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6:/Users/dimitrijer/git/mlai/.venv/lib/python3.6/site-packages"
    }
    }
    

提交回复
热议问题