Wdo2030
Wdo2030

Reputation: 67

Modifying scikit-learn code locally

I am a new python programmer and I just changed an original python file in model_selection folder in anaconda3

However, when I run the code it run the original version not the new one Is there any code I can run to make these changes take a place

The full traceback:

Command "C:\Users....\AppData\Local\Continuum\Anaconda3\python.exe -c "import setuptools, tokenize;file='C:\Users\...\scikit-learn\setup.py';f‌​=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps" failed with error code 1 in C:\Users...\scikit-learn\ –

Thanks

Upvotes: 3

Views: 2470

Answers (1)

TomDLT
TomDLT

Reputation: 4505

You should probably not change the code in anaconda folders. If you want to make changes to scikit-learn code (for yourself), the best way is to:

  1. Uninstall scikit-learn: conda remove scikit-learn or pip uninstall scikit-learn. You can check that it's correctly removed, with pip list and conda list.
  2. Choose a directory where you want to have the scikit-learn files.
  3. From this directory, download the code from github with git: git clone git://github.com/scikit-learn/scikit-learn.git
  4. Install it in an editable fashion with pip: pip install --editable .

Then any edit done on the code will be applied. Note that if you edit Cython/C code (.pyx or .c files), you will have to recompile them before the changes take place, using python setup.py build_ext --inplace

Upvotes: 5

Related Questions