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

ModuleNotFoundError: No module named 'osfclient' #2

Open
jcohenadad opened this issue Jul 7, 2020 · 9 comments
Open

ModuleNotFoundError: No module named 'osfclient' #2

jcohenadad opened this issue Jul 7, 2020 · 9 comments

Comments

@jcohenadad
Copy link
Member

Getting this error with 841c74f on this repos: https://github.com/sct-data/sct_testing_data/tree/30ffe8879d0d942e6565e503deb78044a4c354e5:

julien-macbook:~/temp/sct_testing_data $ distriploy 
2020-07-07 09:58:09 julien-macbook.JOOWIN distriploy.distriploy[5105] ERROR Error importing osf: No module named 'osfclient'
Traceback (most recent call last):
  File "/Users/julien/miniconda3/lib/python3.7/site-packages/distriploy/distriploy.py", line 55, in mirror
    mod = importlib.import_module(".mirror_{}".format(mirror_method_name), package=__package__)
  File "/Users/julien/miniconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/julien/miniconda3/lib/python3.7/site-packages/distriploy/mirror_osf.py", line 5, in <module>
    from .osf import *
  File "/Users/julien/miniconda3/lib/python3.7/site-packages/distriploy/osf.py", line 7, in <module>
    import osfclient
ModuleNotFoundError: No module named 'osfclient'
["https://github.com/sct-data/sct_testing_data/releases/download/r20200504-10-g2da5124/sct_testing_data-r20200504-10-g2da5124.zip"]

i guess we just need to ask users to install https://github.com/osfclient/osfclient, right?

@jcohenadad
Copy link
Member Author

After installing osfclient, i get this:

julien-macbook:~/temp/sct_testing_data $ distriploy 
2020-07-07 10:03:44 julien-macbook.JOOWIN distriploy.distriploy[5452] ERROR Error running osf: 'OSF_USERNAME'
Traceback (most recent call last):
  File "/Users/julien/miniconda3/lib/python3.7/site-packages/distriploy/distriploy.py", line 61, in mirror
    mirror_meta = mod.mirror(repo_path, info, release_meta)
  File "/Users/julien/miniconda3/lib/python3.7/site-packages/distriploy/mirror_osf.py", line 13, in mirror
    username = os.environ["OSF_USERNAME"]
  File "/Users/julien/miniconda3/lib/python3.7/os.py", line 678, in __getitem__
    raise KeyError(key) from None
KeyError: 'OSF_USERNAME'
["https://github.com/sct-data/sct_testing_data/releases/download/r20200504-11-g30ffe88/sct_testing_data-r20200504-11-g30ffe88.zip"]

So, that's something else to document

@jcohenadad
Copy link
Member Author

jcohenadad commented Jul 7, 2020

The following commands are required:

export OSF_USERNAME=<USERNAME>
export OSF_PASSWORD=<PASSWORD>

@jcohenadad
Copy link
Member Author

There is also the possibility to create token with OSF, that would probably be a more sustainable option?

@zougloub
Copy link
Contributor

zougloub commented Jul 7, 2020

Note that the setup.py has an "osf" option which pulls osflient. But I did forget to mention that pip setup option [osf] should be provided to use OSF.

@zougloub
Copy link
Contributor

zougloub commented Jul 7, 2020

Also forgot to document the OSF-related environment variables.

zougloub added a commit that referenced this issue Jul 8, 2020
@zougloub
Copy link
Contributor

zougloub commented Jul 8, 2020

Added README information.

@zougloub zougloub closed this as completed Jul 8, 2020
@jcohenadad
Copy link
Member Author

Note that the setup.py has an "osf" option which pulls osflient. But I did forget to mention that pip setup option [osf] should be provided to use OSF.

reopening to add info in the doc about this

@jcohenadad jcohenadad reopened this Jul 8, 2020
@jcohenadad
Copy link
Member Author

@zougloub how can someone use the osf option mentioned above ^ with pip install?

@zougloub
Copy link
Contributor

zougloub commented Jul 8, 2020

pip install distriploy[osf]

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