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

CI problem - can't import dependency #20

Closed
adamhaber opened this issue Dec 9, 2019 · 1 comment
Closed

CI problem - can't import dependency #20

adamhaber opened this issue Dec 9, 2019 · 1 comment

Comments

@adamhaber
Copy link

Hi,

First of all - thanks for sharing this! I'm just starting to use nbdev but it looks like an amazing platform for library development.

I'm having trouble setting up CI with nbdev. This is possibly not nbdev-related - in which case, I'd appreciate any pointers you might have regarding where to ask this.

One of the dependencies of my library is rpy2. At first I was thinking that Github's CI would "catch" the dependencies and install them (similarly to find_packages()) but the first build failed because rpy2 wasn't installed. I then manually added pip install rpy2 to main.yaml and got:

Collecting rpy2
18
  Downloading https://files.pythonhosted.org/packages/d9/51/d5c41ac70e0aa3272f24cf836bd35d6246c95b98d8d811f338cec5a8098e/rpy2-3.2.2.tar.gz (162kB)
19
    ERROR: Command errored out with exit status 1:
20
     command: /opt/hostedtoolcache/Python/3.6.9/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-alanql6m/rpy2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-alanql6m/rpy2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-alanql6m/rpy2/pip-egg-info
21
         cwd: /tmp/pip-install-alanql6m/rpy2/
22
    Complete output (1 lines):
23
    There is no R_HOME and the R executable cannot be found.

I wasn't able to solve this, so I tried replacing pip install rpy2 with conda install -c r rpy2 in main.yaml. In this case installation was successful, but in the "Run tests" stage I got ModuleNotFoundError: No module named 'rpy2'. The entire trace is available here.

Any help would be much appreciated, and thanks again!

@sgugger
Copy link

sgugger commented Dec 9, 2019

I don't think this is related to nbdev. You need to have R installed according to the docs of rpy2 so you need to add lines to your main.yaml file to do that (I have no knowledge of R so can't help you there).

@sgugger sgugger closed this as completed Dec 9, 2019
jph00 pushed a commit that referenced this issue Jul 24, 2022
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