Open shaman-narayanasamy opened 10 months ago
Hi, did you find the solution? I have the same problem.
Just writing to add I have the same issue as well - conda environment with python version 3.7, along with
conda install xgboost=1.0.2
Tried both regular pip install within the environment as well as cloning from the github repository and installing directly.
Hi, did you find the solution? I have the same problem.
Hi! No, I have not found a solution.
Hi folks, I've made some progress on getting this working.
There are more downstream compatibility issues with XGBoost and Pyrodigal which can be resolved by cloning PhageBoost from Git and rolling dependencies back with
conda create -y -n PhageBoost-env python=3.7
conda activate PhageBoost-env
pip3 install typing_extensions
pip install pyrodigal==0.7.2 xgboost==1.0.2 git+https://github.com/ku-cbd/PhageBoost
The literal import error is resolved by installing typing_extensions
and editing line20 of miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/cachier/core.py
from
from typing import TYPE_CHECKING, Callable, Literal, TypedDict, Optional, Union
to
from typing import TYPE_CHECKING, Callable, Optional, Union
from typing_extensions import Literal, TypedDict
PhageBoost then successfully executes
PhageBoost -f PS18CH-0305-5_contigs.fa -o . -c 1000 --threads 15
processing: PS18CH-0292-1_contigs
time after genecalls: 101.34925127029419
time after feature calculations: 126.40964388847351
time after predictions: 128.9284040927887
{'phage22': 50, 'phage4': 48, 'phage11': 48, 'phage0': 32, 'phage15': 29, 'phage14': 28, 'phage3': 19, 'phage21': 19,
'phage12': 18, 'phage1': 18, 'phage10': 16, 'phage18': 15, 'phage19': 14, 'phage13': 12, 'phage8': 11, 'phage20': 10,
'phage7': 10, 'phage23': 10}
Hope this helps some people
pip install pyrodigal==0.7.2 xgboost==1.0.2 git+https://github.com/ku-cbd/PhageBoost
Hi gwickh,
Thank you very much for the solution! I have tried to fix it, but I found something different in my installation. So in my core.py file, I could only find this in Line17 of "miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/cachier/core.py ", from typing import Optional, Union
. Then I also revised this line as from typing import TYPE_CHECKING, Callable, Optional, Union
from typing_extensions import Literal, TypedDict
Here are the command I issued:
(PhageBoost-env) wet@brl:~$ PhageBoost -h
Traceback (most recent call last):
File "/home/wet/miniconda3/envs/PhageBoost-env/bin/PhageBoost", line 5, in
Do you have any suggestions? I have been frustrated by the installation of phageboost for several weeks. Thank you very much for the help!
Based on this
File "/home/wet/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/cachier/config.py", line 5, in
from typing import Optional, TypedDict, Union
You should go into /home/wet/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/cachier/config.py
and change
from typing import Optional, TypedDict, Union
to
from typing import Optional, Union
from typing_extensions import TypedDict
Let me know if it works!
Based on this
File "/home/wet/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/cachier/config.py", line 5, in from typing import Optional, TypedDict, Union
You should go into
/home/wet/miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/cachier/config.py
and changefrom typing import Optional, TypedDict, Union
to
from typing import Optional, Union from typing_extensions import TypedDict
Let me know if it works!
Hi, thank you for the prompt reply. I have tried again but seemed like more errors in config.py and typing.py. Here are the command I issued:
(PhageBoost-env) wet@brl:~$ PhageBoost -h
Traceback (most recent call last):
File "/home/wet/miniconda3/envs/PhageBoost-env/bin/PhageBoost", line 5, in
Are you able to tell me which Python 3.7 release you are using? Python 3.7.12 doesn't seem to raise that error
Hi, I have checked that I am using the Python 3.7.12 release. Thank you very much for the following.
Hi, I solved this problem based on the solution provided by [gwickh]. Thank you very much for the help and guidance!
So in my case, I revised two files.
(1) miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/cachier/config.py, change from typing import Optional, Union, TypedDict
to from typing import Optional, Union
and from typing_extensions import TypedDict
(2) miniconda3/envs/PhageBoost-env/lib/python3.7/site-packages/cachier/_types.py, change from typing import TYPE_CHECKING, Callable, Literal
to from typing import TYPE_CHECKING, Callable
and from typing_extensions import Literal
Hope this helps some people with the same errors.
@danzheng7372 Solved my problem ImportError: cannot import name 'TypedDict' from 'typing' (/data4/machuang/miniconda3/envs/phageboost/lib/python3.7/typing.py)
Here is my installation process,
conda create -y -n phageboost python=3.7
conda activate phageboost
pip install pyrodigal==0.6.4 xgboost==1.0.2 typing_extensions PhageBoost --index-url https://pypi.tuna.tsinghua.edu.cn/simple
(1) miniconda3/envs/phageboost/lib/python3.7/site-packages/cachier/config.py, changefrom typing import Optional, Union, TypedDict
to from typing import Optional, Union
and from typing_extensions import TypedDict
(2) miniconda3/envs/phageboost/lib/python3.7/site-packages/cachier/_types.py, changefrom typing import TYPE_CHECKING, Callable, Literal
to from typing import TYPE_CHECKING, Callable
and from typing_extensions import Literal
PhageBoost -h
Running the test file will still report an error KeyError: 'X'
It is possible to use GitHub version
git clone https://github.com/ku-cbd/PhageBoost.git
cd PhageBoost
pip install .
Then run PhageBoost -f example/data/NC_000907.fasta.gz -o results
You'll get
processing: NC_000907
time after genecalls: 1.2304344177246094
time after feature calculations: 5.240534067153931
time after predictions: 7.159439563751221
{'phage6': 51, 'phage5': 26}
Good to konw that it works! @AndAvia
Dear authors/developers,
I am unable to execute PhageBoost after installation via conda + pip. Here are the command I issued:
I tested it on two independent systems, both resulting in the same error. I also skimmed though the current open and closed issues on the github but could not find anything related to this issue. I would appreciate your help in solving this issue.
I look forward to hearing from you.
Best regards, Shaman