MolecularAI / aizynthfinder

A tool for retrosynthetic planning
https://molecularai.github.io/aizynthfinder/
MIT License
583 stars 134 forks source link

error when installing the aizynthcli and aizynthapp tools #74

Closed hongxianglics closed 2 years ago

hongxianglics commented 2 years ago

when I input the code aizynthcli --config config.yml --smiles smiles.txt aizynthapp --config config.yml

I got the error as return FileNotFoundError: [Errno 2] No such file or directory: 'config.yml'

could you help me find out the problem? Thanks!

SGenheden commented 2 years ago

Hello

First it seems that you are trying to run two commands in one line. aizynthcli and aizynthapp are two different tools.

Second config.yml is a configuration that specifies the policies and stocks you want to use. If you continue reading the README file after the two lines you have entered, you see how you can use the download_public_data tool to download such data and create a config.yml file in the process.

hongxianglics commented 2 years ago

Hi, I have already download the file to my folder with this code: download_public_data /Users/miao/vscode/aizynthfinder-master and it works well with the successful return: download_public_data /Users/miao/vscode/aizynthfinder-master uspto_model.hdf5: 100%|██████████████████████| 300M/300M [00:16<00:00, 18.5MB/s] uspto_templates.hdf5: 100%|████████████████| 44.6M/44.6M [00:02<00:00, 17.1MB/s] zinc_stock.hdf5: 100%|███████████████████████| 663M/663M [00:44<00:00, 15.0MB/s] uspto_filter_model.hdf5: 100%|█████████████| 50.4M/50.4M [00:03<00:00, 16.1MB/s] Configuration file written to config.yml (aizynth-env) wirelessprv-10-194-4-43:~ miao$

However, when I try to install aizynthcli with the code: aizynthcli --config config.yml --smiles smiles.txt

it still can not find the file FileNotFoundError: [Errno 2] No such file or directory: 'config.yml' and I copy the whole return here: aizynthcli --config config.yml --smiles smiles.txt Traceback (most recent call last): File "/Users/miao/opt/anaconda3/envs/aizynth-env/bin/aizynthcli", line 8, in <module> sys.exit(main()) File "/Users/miao/opt/anaconda3/envs/aizynth-env/lib/python3.9/site-packages/aizynthfinder/interfaces/aizynthcli.py", line 271, in main finder = AiZynthFinder(configfile=args.config) File "/Users/miao/opt/anaconda3/envs/aizynth-env/lib/python3.9/site-packages/aizynthfinder/aizynthfinder.py", line 65, in __init__ self.config = Configuration.from_file(configfile) File "/Users/miao/opt/anaconda3/envs/aizynth-env/lib/python3.9/site-packages/aizynthfinder/context/config.py", line 114, in from_file with open(filename, "r") as fileobj: FileNotFoundError: [Errno 2] No such file or directory: 'config.yml' (aizynth-env) wirelessprv-10-194-4-43:~ miao$ Could you help me find the problem, thanks!

SGenheden commented 2 years ago

It looks like you are downloading the config.yml to the folder /Users/miao/vscode/aizynthfinder-master, but I am unsure if it is from this folder you are trying to run aizynthcli.

Perhaps if you try aizynthcli --config /Users/miao/vscode/aizynthfinder-master/config.yml --smiles smiles.txt it will work?

Specifying a filename like config.yml in a terminal is specifying the relative path to the file, in this case it assumes that config.yml is in the same folder as you are executing the command.

SGenheden commented 2 years ago

Closing this due to inactivity.