microsoft / anomalydetector

SR-CNN
MIT License
257 stars 70 forks source link

import cython error #29

Open 8188 opened 3 years ago

8188 commented 3 years ago

When I executing "from _anomaly_kernel_cython import median_filter" --> ImportError: Building module _anomaly_kernel_cython failed: ['distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat\n']

I have installed Microsoft LightSwitch for Visual Studio 2015 14.0.25431.01 Update 3 System: windows 10 python: 3.6

How can I solve it?

DJofOUC commented 3 years ago

I meet the same error

soemthlng commented 3 years ago

When I run main.py, I meet " ModuleNotFoundError: No module named 'msanomalydetector._anomaly_kernel_cython' "

System: wsl16.04 python3.7 and jupyter notebook python3.6

Is there any solution?

Cesuuur commented 2 years ago

i have run into the same problem, @soemthlng did you solve it?

soemthlng commented 2 years ago

@Cesuuur No, I can not solve it.

Cesuuur commented 2 years ago

Hello, the other day I found the solution to this issue.

Cython is C code that integrates with Python to make code more efficient. The .pyx file needs to be compiled to generate the C file.

I executed the following command and I already managed to run the code:

python setup.py build_ext --inplace
aquirin-te commented 10 months ago

Hello, this command does not work on my side. I have an error message related to Cython... Any help please?

Ouput of:

python setup.py build_ext --inplace

https://pastebin.com/bCwZS0nh

Please can you indicate the version of Python and Cython you are using? I am working on Mac OS by the way.

Versions on my side:

Python: 3.9.4
Cython==3.0.4
numpy==1.26.1
pandas==2.1.1
aquirin-te commented 10 months ago

Issue solved with:

pip install Cython==3.0.3
python setup.py build_ext --inplace
python setup.py install