0

i am trying to create an executable using cx_freeze. and when i run python setup.py build i get the following error:

from setuptools.errors import OptionError
    ImportError: cannot import name 'OptionError' from 'setuptools.errors'

I am working in anaconda. I tried reverting to a previous cx_freeze version with no luck. This a a new problem two month ago when i created another virtual envieonment i didn't have this problem. This is why i'm guessing it could be maybe a version issue. However i can't seem to find the correct version to install. i also checked other related issues however i didn't find a solution that works for me. If you have an idea please let me know! Thank you

lana
  • 1

1 Answers1

0

It's difficult to tell without additional info, package versions, a more complete trace, etc.

I ran into this same error during a build post-upgrade of cx_Freeze but after already having setuptools installed. Reinstalling setuptools to the most current version (65.6.3) corrected the error in my case. I'm running cx_Freeze version 6.13.1 if it helps move you past the error.

Typically, Python errors of the sort ImportError: cannot import name ... indicate circular dependencies, e.g.,: https://stackoverflow.com/a/9252628/9975319 - it could be that the order of imports cx_Freeze does changes across builds causing the dependencies to import incorrectly but I haven't dug deeper into it.

diddlybop
  • 51
  • 1
  • 3