Getting error in line from .ddg import ddg

Hi All,
strong text
beginner on this setup.
Any idea how to fix below error ??

File “/opt/conda/lib/python3.7/site-packages/IPython/core/interactiveshell.py”, line 3457, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File “/tmp/ipykernel_17/1717929076.py”, line 1, in
from duckduckgo_search import ddg_images

File “/opt/conda/lib/python3.7/site-packages/duckduckgo_search/init.py”, line 9, in
from .ddg import ddg

File “”, line 1
(keywords=)
^
SyntaxError: invalid syntax

while installing duckduckgo_search saw below

if iskaggle:
!pip install -Uqq fastai duckduckgo_search

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tensorflow-io 0.21.0 requires tensorflow-io-gcs-filesystem==0.21.0, which is not installed. explainable-ai-sdk 1.3.2 requires xai-image-widget, which is not installed. dask-cudf 21.10.1 requires cupy-cuda114, which is not installed. beatrix-jupyterlab 3.1.6 requires google-cloud-bigquery-storage, which is not installed. tensorflow 2.6.2 requires numpy~=1.19.2, but you have numpy 1.20.3 which is incompatible. tensorflow 2.6.2 requires six~=1.15.0, but you have six 1.16.0 which is incompatible. tensorflow 2.6.2 requires typing-extensions~=3.7.4, but you have typing-extensions 3.10.0.2 which is incompatible. tensorflow 2.6.2 requires wrapt~=1.12.1, but you have wrapt 1.13.3 which is incompatible. tensorflow-transform 1.5.0 requires absl-py<0.13,>=0.9, but you have absl-py 0.15.0 which is incompatible. tensorflow-transform 1.5.0 requires numpy<1.20,>=1.16, but you have numpy 1.20.3 which is incompatible. tensorflow-transform 1.5.0 requires pyarrow<6,>=1, but you have pyarrow 6.0.1 which is incompatible. tensorflow-transform 1.5.0 requires tensorflow!=2.0.,!=2.1.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.*,<2.8,>=1.15.2, but you have tensorflow 2.6.2 which is incompatible. tensorflow-serving-api 2.7.0 requires tensorflow<3,>=2.7.0, but you have tensorflow 2.6.2 which is incompatible. gcsfs 2021.11.1 requires fsspec==2021.11.1, but you have fsspec 2022.2.0 which is incompatible. flake8 4.0.1 requires importlib-metadata<4.3; python_version < “3.8”, but you have importlib-metadata 4.11.3 which is incompatible. featuretools 1.6.0 requires numpy>=1.21.0, but you have numpy 1.20.3 which is incompatible. dask-cudf 21.10.1 requires dask==2021.09.1, but you have dask 2022.2.0 which is incompatible. dask-cudf 21.10.1 requires distributed==2021.09.1, but you have distributed 2022.2.0 which is incompatible. apache-beam 2.34.0 requires dill<0.3.2,>=0.3.1.1, but you have dill 0.3.4 which is incompatible. apache-beam 2.34.0 requires httplib2<0.20.0,>=0.8, but you have httplib2 0.20.2 which is incompatible. apache-beam 2.34.0 requires pyarrow<6.0.0,>=0.15.1, but you have pyarrow 6.0.1 which is incompatible. aioitertools 0.10.0 requires typing_extensions>=4.0; python_version < “3.10”, but you have typing-extensions 3.10.0.2 which is incompatible. aiobotocore 2.1.2 requires botocore<1.23.25,>=1.23.24, but you have botocore 1.24.20 which is incompatible.

add Codeadd Markdown

PS: I have restarted kernel / cleaned my draft notebook and started afresh with “copy and edit” Is it a bird? Creating a model from your own data | Kaggle

Do you still get this error when you run all (in colab, it’ll be by clicking on Runtime > Run All)?

Yes…I do get the same error

currently using this…

!pip list | grep -E ‘fastai|duck*’
duckduckgo-search 2.9.4
fastai 2.7.12

workaround found.

Create a new notebook, copy paste all cell contents into new notebook.
its working fine now, you may please close this thread.

I’m seeing the same issue. No idea how to go about fixing this. How did you move all the cells to a new notebook @rohil? One by one?

yes…copied one-by-one
usual grand old Ctrl-C and Ctrl-V into new notebook from old notebook.

Hi there,
I was having the same issues. After I tried a few more times, The cell was executed without the error, but I still got an error in the next cell.
I assumed the previous cell was successfully executed because I didn’t get an error there, and the marker changed to [11], on the left side. While the next cell, with the error, is marked [12].

Anyways, I was having the same issues as you guys in the previous 2 cells. The errors disappeared after a few tries.