xlang-ai/Binder

Conda env create does not work

ron-vnai opened this issue ยท 12 comments

I tried to create a proper env using

conda env create -f py3.7binder.yaml
pip install records==0.5.3

however, the conda command fails.

I tried it over Mac OS, Unbuntu ec2 machine, Windows. Could you please verify and update the yaml file?

Hi,

Thanks for asking!
The env was exported by anaconda from my MacBook, thus may have some dependencies on hardware and system. You can try to manually pip install packages without having specified constraints as shown in py3.7binder.yaml.
I hope this information ca help you!

Tianbao

Hi Tianbao,
Thank you so much for your prompted response.

I have tried your suggested approach, however, it fails with too many errors. Unfortunately, in such case I cannot assess your published method at all.

It might be a lot to ask, however, could you validate that the environment works on a fresh machine (e.g., simple ubuntu linux based cloud instance)? It would be a great help!

Thanks! Ron V.

Thanks for your response, I will try that in AWS these days=)

[Update]

I tried it myself on the server, and indeed there are errors when replicating the environment, @Timothyxxx will fix that these days.

Thank you very much!
I appreciate it a lot!

Hi @ron-vnai ! I tested the install script on my Mac OS X with anaconda and succeeded. Could you provide more details, e.g., the error info(a few lines are also appreciated!) on Mac OS, to help us better inspect the causes?

Hi @BlankCheng!

conda env

I was getting the following error:

  ----------------------------------------
  ERROR: Failed building wheel for h5py
ERROR: Could not build wheels for h5py which use PEP 517 and cannot be installed directly

I was able to solve this by installing h5py (following instructions from https://anaconda.org/conda-forge/h5py)

run.py issues

I had to fix "root dir" path issues in the run.py and scripts/annotate_binder_program.py scripts.
I managed to solve it, e.g.,

import sys

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))

sys.path.append(ROOT_DIR)

from generation.generator import Generator
from utils.utils import load_data_split
from nsql.database import NeuralDB

Then I encountered the following missing file error: "FileNotFoundError: [Errno 2] No such file or directory: '.../key.txt'" and realized that this file should contain the open-ai key.

Finally

Since I am not sure that the running environment is installed correctly, I have stopped my efforts here. I would appreciate your help.

Thanks,
Ron

Hi, thanks for your detailed information!

You are right, I think your env is settled now and you just missed the "key.txt". You may create a key.txt file under the main project, i.e., the parent directory of scripts/. Then copy your openai-key in it (multiple lines if multiple keys).

Thanks for your patience.
Zhoujun

Strongly agree with Zhoujun, it seems now the only barrier between you and Binder is an OpenAI key!

Hope you enjoy your new trip with it! ๐Ÿบ

Feel free to re-open this if you have any more questions!

Thanks - and thank you for sharing the code!

Sry I've got some issues when executing

conda env create -f py3.7binder.yaml

My terminal prints:

Collecting package metadata (repodata.json): done
Solving environment: failed
ResolvePackageNotFound: 
  - python==3.7.11=h88f2d9e_0
  - ncurses==6.3=hca72f7f_2
  - tk==8.6.11=h7bc2e8c_0
  - openssl==1.1.1o=hca72f7f_0
  - pysocks==1.7.1=py37hecd8cb5_0
  - cryptography==37.0.1=py37hf6deb26_0
  - certifi==2022.6.15=py37hecd8cb5_0
  - urllib3==1.26.9=py37hecd8cb5_0
  - brotlipy==0.7.0=py37h9ed2024_1003
  - libcxx==12.0.0=h2f01273_0
  - cffi==1.15.0=py37hc55c11b_1
  - setuptools==58.0.4=py37hecd8cb5_0
  - zlib==1.2.11=h4dc903c_4
  - sqlite==3.37.2=h707629a_0
  - xz==5.2.5=h1de35cc_0
  - ca-certificates==2022.4.26=hecd8cb5_0
  - readline==8.1.2=hca72f7f_1
  - pip==21.2.2=py37hecd8cb5_0
  - libffi==3.3=hb1e8313_2

I reviewed the yaml file and found it seems that you had exported the yaml file with build info , that's why you guys could pass the setup test script LOL.

I pull requests to fix it.