1
votes

I have created a setup.py file which contains the following code

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext= Extension("helloworld", sources=["helloworld.pyx"])
setup(ext_modules =[ext],
      cmdclass={'build_ext':build_ext})

However when i tried the command: python setup.py build_ext --inplace an attributed error was given. The compilation output was:

Traceback (most recent call last): File "setup.py", line 1, in from distutils.core import setup File "C:\Python34\lib\distutils\core.py", line 16, in from distutils.dist import Distribution File "C:\Python34\lib\distutils\dist.py", line 7, in import sys, os, re File "C:\Users\Payal Singh\Desktop\python all\re.py", line 4, in match=re.search(r'([\w\d.]+)@([\w.]+)',str) AttributeError: 'module' object has no attribute 'search'

1

1 Answers

2
votes

You have named your file "re.py" the same as python's regular expression module "re". Importing "re" imports a local module.