I get an error in python3 when importing mechanize

前端 未结 3 1397
感情败类
感情败类 2020-12-17 09:52

I get an error in python3 when importing mechanize.

I\'ve just installed mechanize into my virtualenv where python3 is installed.

$ which python3
/Us         


        
3条回答
  •  一个人的身影
    2020-12-17 10:37

    I think you may have installed the Python 2 version of mechanize, and the new Python 3 import semantics are breaking the old Python 2 code. A quick search, and it seems like Python 3 support for mechanize is still a bit weak. However, I did find a Python 3 branch.

    You could try manually installing from the source code I linked to. Once you've downloaded the source, change your directory so that you're in the mechanize directory. Then enter $python3 setup.py install in the terminal.

提交回复
热议问题