ImportError: cannot import name constants

前端 未结 2 1554
谎友^
谎友^ 2021-01-02 20:20

I\'m trying to run a simple piece of code using pyzmq. I am using Python 2.7 and pyzmq 14.5

$ python --version
Python 2.7.6
$ sudo find /usr -name "*pyzm         


        
相关标签:
2条回答
  • 2021-01-02 20:49

    so, what worked for me in this case is the following solution from Osiris from letsencrypt forum:

    1. the problem is that you have 2 versions of certbot (in my case I understood that by command:

    whereis certbot

    the output was like this:

    certbot: /usr/bin/certbot /usr/local/bin/certbot /usr/share/man/man1/certbot.1.gz

    1. then I tried to renew both of them wiht the commands:

    /usr/bin/certbot renew
    /usr/local/bin/certbot renew

    and I got the error:
    An unexpected error occurred: ImportError: cannot import name 'constants'
    ...with the 2nd one!
    so, I used the following command to remove this folder:
    sudo rm usr/local/bin/certbot

    Then the error was gone
    Hope that helps

    0 讨论(0)
  • 2021-01-02 21:01

    I encountered a similar problem. pip install --upgrade pyzmq did the trick for me

    0 讨论(0)
提交回复
热议问题