title: Running pip install twice to see changes ("developer mode") -- second install fails but first works
body: <p>I am wondering how to use pip to develop a Python package which is going through many revisions rapidly. My work flow is to write C++ code, compile and install with <code>pip install</code> and test my code.</p>
  <p>Then, I would like to change some underlying C++ code, recompile and reinstall with pip, test the new feature, change something else, go back etc. until my package is ready.</p>
  <p>Why did <code>pip install ./cmake_example</code> work well the first time but when making changes to the code, reinstalling with recompiling produced an error? I just re-ran the command <code>pip install ./cmake_example</code>.</p>
  <p>I changed a single line of C++ code in an innocuous way (adding +1 in the 'add' function just to see if I can change code and recompile) and the code compiled fine in my IDE without pip.</p>
  <p>My basic idea was to use <code>pip</code> following <a href="https://stackoverflow.com/questions/41060382/using-pip-to-install-packages-to-anaconda-environment">this method</a> to avoid having to hackishly insert my shared object into some python directory each time I make a change.</p>
  <p>I used the cmake_example from pybind <a href="https://github.com/pybind/cmake_example" rel="nofollow noreferrer">here</a> and followed the steps and did <code>pip install ./cmake_example</code> and it worked very well. I ran the example fine in a Python console.</p>
  <p>Then, I changed some code (just added +1 to the adding function), so nothing substantial and wanted to <code>re-install</code> the package.</p>
  <p>I then got this error:</p>
  <pre><code>Building wheels for collected packages: cmake-example
    Building wheel for cmake-example (pyproject.toml) ... error
    error: subprocess-exited-with-error
  
    × Building wheel for cmake-example (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─&gt; [65 lines of output]
        running bdist_wheel
        running build
        running build_ext
        CMake Error at CMakeLists.txt:2 (project):
          Running
  
           '/tmp/pip-build-env-q_8_pyjk/overlay/bin/ninja' '--version'
  
          failed with:
  
           No such file or directory
  </code></pre>
  <p>and</p>
  <pre><code>ERROR: Could not build wheels for cmake-example, which is required to
  install pyproject.toml-based projects
  </code></pre>
  <p>I have tried <code>pip uninstall cmake_example</code> and then reinstall but to no avail. The <code>upgrade</code> function did not work either. Does pip change something in the project folder?</p>
  <p>PS: The makers of pybind11 also provide a scikit example <a href="https://github.com/pybind/scikit_build_example" rel="nofollow noreferrer">here</a> where removing the cache for repeated builds is not necessary. The <code>cmake_example</code> seems to be intended for legacy projects that do not use the cmake extension scikit. So if the structure of the <code>cmake_example</code> is essential to the project, removal of the cache is the only way to go.</p>