-1

I want to speed up my python code so i tried to translate it in c thanks to cython. I followed the basics tutorials and other youtube videos and i finally could create a functions_cython.c file. But somehow i just can't import it. I tried to import it in my main file, i also tried in another file named 'testing.py' but I always receive errors saying that the module 'functions_cython' does not exist, while it actually is in the file. Do you have any idea why ? (i linked some images if that can help)

  • can you make it "import .functions_cython as fc" , the dot in there can solve some issues if your current directory and python path are set incorrectly, in other words, the dot is "import from this directory" – Ahmed AEK Dec 07 '21 at 09:14
  • This doesn't work :/ – eglantine_viala Dec 07 '21 at 09:30
  • Downvoted and voted to close because images of code _do not help_. Please post code as text and make sure it is sufficient to reproduce the problem. Realistically that means the contents of your Cython file (not the .c file) and the steps you took to compile it. – DavidW Dec 07 '21 at 20:08
  • Please provide enough code so others can better understand or reproduce the problem. – Community Dec 13 '21 at 00:05

1 Answers1

0

The problem was because I was using PyCharm's "community version" and this version (in opposition of the professional one) does not allow to import .c formats. I switched to VS Code.