ScriptEditor automatically install older packages

How to solve the following problem:

I locally installed a python package version 2.0.10:
C:/Users/petras/.rhinocode/py39-rh8/python.exe -m pip install .

It does the following:

If there is even a small error in Grasshopper component using ScriptEditor, it download a pip version uploaded before, in this case 2.0.9. It is really annoying because everytime I must close rhino delete all these folders and try again because the pip installable package is always loaded first:

Why this happens?
What triggers pip installation even #r packagename is not defined?
It would be nicer that pacakage that is loaded would be dependent on the version number.

pip does not install anything if there are no #r : <package-spec> entries in your scripts. It does run pip list to collect the installed packages but that is different.

Is there an example you can share that replicates this error? Also I would really like to know why you are not installing compas_wood using the #r: compas_wood entry? Is there a problem with that install?

We are still talking about this repository:
https://petrasvestartas.github.io/compas_wood/latest/installation/conda.html

The problem is following:

  1. r# use PiPy
  2. I develop in my own computer.
  3. once the code is ready I ship it to pipy, but the bigger time of work is local not published developed.
  4. everytime the scripteditor goes through import even without specifying #r, if the package is missing it tries to install it through pip, which always conflict with local build.

I know that this point was discussed numerous times. But instead of description, can you provide a set of bash commands how you install local package on your py to Rhino python so that it will not use PyPi in the first place?

I always do this:

  1. C:/Users/petras/.rhinocode/py39-rh8/python.exe -m pip install . (–target did not work for me)
  2. I open rhino and my code
  3. Script Editor tries to install previous PyPi package with the same name
  4. I go to folder and delete manually the PyPi package, so that the 1st step would work
  5. I run the code
  6. After many different iterations code refinement, I publish to PyPi, but this is the very last step for users, not developers.

The PyPi and local package with the same name conflicts all the time even if the local package has the higher version than local one, it still tries to install it.
I got used it by manually deleting files. But it is a bit tedious specially when shifting between mac, windows and linux…

I think ScriptEditor needs a proper McNeel website page with a tutorial from zero to hero for developers.

Note to dev. This might be a similar issue as: