jthegedus / asdf-gcloud

☁️ GCloud CLI (Google Cloud SDK) plugin for asdf version manager. Pin gcloud versions for each project!
https://asdf-vm.com
MIT License
55 stars 22 forks source link

Error on install plugin #26

Closed LuanNunes closed 3 years ago

LuanNunes commented 4 years ago

When I try install the plugin, this give me the error: asdf install gcloud latest
mkdir: cannot create directory ‘/home/luan/.asdf/downloads/gcloud/311.0.0’: File exists ⏬ downloading google-cloud-sdk-311.0.0-linux-x86_64.tar.gz ###################################################################################################### 100,0% ✅ downloaded! ✅ All dependencies found on system! 📦 extracting... ✅ extracted! 🚧 installing... Welcome to the Google Cloud SDK! Traceback (most recent call last): File "/home/luan/.asdf/installs/gcloud/311.0.0/bin/bootstrapping/install.py", line 12, in import bootstrapping File "/home/luan/.asdf/installs/gcloud/311.0.0/bin/bootstrapping/bootstrapping.py", line 44, in from googlecloudsdk.core.credentials import store as c_store File "/home/luan/.asdf/installs/gcloud/311.0.0/lib/googlecloudsdk/core/credentials/store.py", line 40, in from googlecloudsdk.core.credentials import creds as c_creds File "/home/luan/.asdf/installs/gcloud/311.0.0/lib/googlecloudsdk/core/credentials/creds.py", line 41, in import sqlite3 File "/home/luan/.asdf/installs/python/3.8.5/lib/python3.8/sqlite3/init.py", line 23, in from sqlite3.dbapi2 import File "/home/luan/.asdf/installs/python/3.8.5/lib/python3.8/sqlite3/dbapi2.py", line 27, in from _sqlite3 import ModuleNotFoundError: No module named '_sqlite3'

Can you help me?

ivanoats commented 3 years ago

I am also having what I believe is this same issue with sqlite

❯ asdf plugin add gcloud https://github.com/jthegedus/asdf-gcloud.git
Plugin named gcloud already added
❯ asdf install gcloud latest
mkdir: cannot create directory ‘/home/ivan/.asdf/downloads/gcloud/321.0.0’: File exists
⏬  downloading google-cloud-sdk-321.0.0-linux-x86_64.tar.gz
################################################################################################################# 100.0%
✅  downloaded!
✅  All dependencies found on system!
📦  extracting...
✅  extracted!
🚧  installing...
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
  File "/home/ivan/.asdf/installs/gcloud/321.0.0/bin/bootstrapping/install.py", line 12, in <module>
    import bootstrapping
  File "/home/ivan/.asdf/installs/gcloud/321.0.0/bin/bootstrapping/bootstrapping.py", line 44, in <module>
    from googlecloudsdk.core.credentials import store as c_store
  File "/home/ivan/.asdf/installs/gcloud/321.0.0/lib/googlecloudsdk/core/credentials/store.py", line 41, in <module>
    from googlecloudsdk.core.credentials import creds as c_creds
  File "/home/ivan/.asdf/installs/gcloud/321.0.0/lib/googlecloudsdk/core/credentials/creds.py", line 41, in <module>
    import sqlite3
  File "/home/ivan/.asdf/installs/python/3.9.1/lib/python3.9/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/home/ivan/.asdf/installs/python/3.9.1/lib/python3.9/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
ivanoats commented 3 years ago

If anyone is running into this sqlite issue with asdf version manager and asdf-gcloud plugin, I was able to fix this by setting $CLOUDSDK_PYTHON to my system python at /usr/bin/python3.8

jthegedus commented 3 years ago

Thanks for the report and sorry for not replying sooner (no notification :upside_down_face:)

I will look into this as $CLOUDSDK_PYTHON should be auto-detected. Perhaps the install script was changed and no longer does some of the parsing it used to :thinking:

@ivanoats did you try non-system python installs?

This could also be an asdf-python issue. Has anyone had issues with installing sqlite via asdf-python manually?

jthegedus commented 3 years ago

I ran into a similar (not exactly the same) issue with gcloud 316.0.0 that didn't present on gcloud 333.0.0, so perhaps this only affects specific gcloud versions :thinking:

RafalSkolasinski commented 3 years ago

~Is setting of CLOUDSDK_PYTHON only important for installation or every invocation of command?~

Yeah, just set it in my fish.conf.

jthegedus commented 3 years ago

I will close for now, please re-raise this issue if anyone comes across this problem after setting CLOUDSDK_PYTHON

cguo5520 commented 3 years ago

This is happening for me on 348.0.0 and 333.0.0. The fix of setting CLOUDSDK_PYTHON to /usr/bin/python worked. This only started happening to me once I started using asdf-python

jthegedus commented 3 years ago

You can set your global version of Python to system with asdf global python system and it will fallback to your system Python. This should get around setting CLOUDSDK_PYTHON manually.

jetersen commented 2 years ago

doing both asdf global python system or CLOUDSDK_PYTHON does not help.

I needed to actually install a python version asdf install python 3.9.10 I think the issue is check_dependencies excepts to find a folder ~/.asdf/installs/python Even though I end up using asdf global python system

b00kdev commented 1 year ago

I was able to get this working with asdf-python by installing libsqlite3-dev and then re-installing asdf-python. After that, it looks like sqlite can be found.

jthegedus commented 1 year ago

I think the issue is check_dependencies excepts to find a folder ~/.asdf/installs/python

The check_dependencies function tries to exec a binary available on your PATH, if it is not available it is assumed to not exist.

@b00kdev That is a curious scenario. As an aside, after installing libsqlite3-dev you should be able to run asdf reshim python instead of re-installing the plugin.