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

Cannot run via pipx #69

Open
stephenreay opened this issue Mar 28, 2024 · 1 comment
Open

Cannot run via pipx #69

stephenreay opened this issue Mar 28, 2024 · 1 comment

Comments

@stephenreay
Copy link
Contributor

stephenreay commented Mar 28, 2024

After the 'simple' fixes in #68 schemasync seems to run properly under python3 again, but when trying to install it as a global tool we're advised to no longer use sudo pip install but instead to use pipx (with some other hoop jumping to get a truly global install).

However something isn't quite right when it's installed this way, but I can't quite tell what.

Using schemasync from a pipx install (using a local copy of the repo with the fixes applied in #68 as the source) gives:

Traceback (most recent call last):
  File "/home/vagrant/.local/bin/schemasync", line 5, in <module>
    from schemasync.schemasync import main
  File "/home/vagrant/.local/pipx/venvs/schemasync/lib/python3.11/site-packages/schemasync/schemasync.py", line 9, in <module>
    import syncdb
ModuleNotFoundError: No module named 'syncdb'

The schemasync executable at /home/vagrant/.local/bin/schemasync contains this:

#!/home/vagrant/.local/pipx/venvs/schemasync/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from schemasync.schemasync import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Even weirder, if I just execute the main schemasync.py file directly using that env's python, it works fine:

/home/vagrant/.local/pipx/venvs/schemasync/bin/python /home/vagrant/.local/pipx/venvs/schemasync/lib/python3.11/site-packages/schemasync/schemasync.py 

Python isn't really my deal, I'm just trying to make this tool work for a client's project. It'd be great if someone a little more knowledgeable in Python could look into this. I don't have unlimited time to mess around with it, but if there are suggestions of what to try, I can do so, within reason.

@mitsh
Copy link
Collaborator

mitsh commented Mar 29, 2024

I'll check it in a days maybe but if you fix it and make PR I'll accept it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants