Python AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

后端 未结 20 1637
無奈伤痛
無奈伤痛 2020-11-29 02:06

A Python script of mine is failing with:

Traceback (most recent call last):
  File \"./inspect_sheet.py\", line 21, in 
    main()
  File \"./i         


        
20条回答
  •  野性不改
    2020-11-29 02:36

    This is an older post, so I'm answering to hopefully help someone in late 2019... my problem had to do with Python 2 vs 3. I'm using Python 3 exclusively; no more legacy Python. But my OS (eg, Ubuntu 16.04) still has Python 2.7 installed. Thus when running global pip by default (eg, not in a virtualenv), I was calling the Python 2 version of pip.

    For me, I used the following to fix this issue.

    Uninstall docker-compose:

    sudo pip3 uninstall docker-compose  
    sudo pip uninstall docker-compose
    

    Reinstall docker-compose for my version of Python:

    sudo pip3 install docker-compose
    

提交回复
热议问题