Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Repeated python3 setup.py install leads to errors at startup, service loading #1935

Open
relativisticelectron opened this issue Oct 21, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@relativisticelectron
Copy link
Collaborator

relativisticelectron commented Oct 21, 2022

Steps to reproduce

When running

pip install -e .  && python3 setup.py install 

for the first time the python folder python3.10/site-packages/ contains
image
and python3.10/site-packages/cryptoadvance/specterext/ contains
image

However running

pip install -e .  && python3 setup.py install 

again , now

  • python3.10/site-packages/cryptoadvance/specterext/ contains
    image
    which then raises the exception at specter start;
cryptoadvance.specter.specter_error.SpecterError: 
                Module cryptoadvance.specterext.liquidissuer.service  could not be found. This could have these reasons:
  • python3.10/site-packages/ remains contains the same folders.

Cause

Running pip install -e . for the 2. time completely deletes the python3.10/site-packages/cryptoadvance folder (without noticing that it deleted the folders of some of the required packages).

Workaround

Currently I have to do pip uninstall of all services in python3.10/site-packages/cryptoadvance/specterext/ and rerun pip install -e . && python3 setup.py install .

Solutions?

  • The services specterext-exfund, specterext-faucet, cryptoadvance-liquidissuer should NOT be located in cryptoadvance/specterext/

@k9ert: What do you think?

@relativisticelectron relativisticelectron changed the title Bug: Repeated python3 setup.py install leads to errors in services Bug: Repeated python3 setup.py install leads to errors at startup, service loading Oct 21, 2022
@k9ert
Copy link
Collaborator

k9ert commented Oct 26, 2022

Tested it (with python3.9) and can't reproduce.

This might be due to at least one of the extensions (or specter itself) having a __init__.py file in ./src/cryptoadvance, or ./src/cryptoadvance/specterext/. That should not be the case. The reason is an explicit design-decision i did back in #524 : cryptoadvance and later cryptoadvance/specterext should be namespace-packages exactly in order to make it possible to "merge" specifc subtrees together in one virtualenv. For that to work, the corresponding directory needs to be empty.

Can you check that in your case? I guess i recently discovered something similiar and removed it but can't remember where.
And sorry for the late reply.

@k9ert k9ert added the question Further information is requested label Oct 26, 2022
@k9ert
Copy link
Collaborator

k9ert commented Oct 26, 2022

Not sure why i couldn't reproduce in the first place but now i can :-|

@k9ert k9ert added bug Something isn't working and removed question Further information is requested labels Oct 26, 2022
@k9ert
Copy link
Collaborator

k9ert commented Oct 26, 2022

I think that python3 setup.py install was never ok in the first place. IMHO it's installing specter-desktop as a regular package. If then, the second time, pip install -e . is realizing that the package is installed regulary and removes it (unfortunately not properly).
We have to revisit why we're installing it in the first place.

@relativisticelectron
Copy link
Collaborator Author

relativisticelectron commented Nov 11, 2022

We have to revisit why we're installing it in the first place.

Well, I am re-installing it after I changed something (and do not want to setup a completely new virtualenv every time):

pip3 install -e .

@relativisticelectron
Copy link
Collaborator Author

@k9ert : Do you have any idea for a solution? This is an annoying bug in development (and I expect also users using pip will encounter this).

@relativisticelectron
Copy link
Collaborator Author

My current understanding:
pip3 install -e . (or pip3 install . ) installs

  • cryptoadvance.specter
  • and dependencies like cryptoadvance-liquidissuer

python3 setup.py install then overwrites cryptoadvance.specter.

Calling pip3 install -e . again then notices that cryptoadvance.specter was modified, and then just deletes the whole folder, while not reinstalling the dependencies.

This leads to the following steps that seems to work:

  1. pip install --require-hashes -r requirements.txt
  2. python3 setup.py install

These 2 steps can be repeated without problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants