To Solve error in mongoengine setup command: use_2to3 is invalid Error Here it should be setuptools>=58 breaks support for use_2to3 thats why you are facing this error. Here is Official message Removed support for 2to3 during builds. Projects should port to a unified codebase or pin to an older version of Setuptools using PEP 518 build-requires. To solve this error you should consider to update setuptools to setuptools<58. You can update setup tools with these command line.