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

Conflicting dependencies when installing #97

Closed
AtomicNess123 opened this issue Sep 13, 2022 · 9 comments
Closed

Conflicting dependencies when installing #97

AtomicNess123 opened this issue Sep 13, 2022 · 9 comments

Comments

@AtomicNess123
Copy link

How to fix this problem?

ERROR: Cannot install khoj-assistant==0.1.0, khoj-assistant==0.1.2, khoj-assistant==0.1.3 and khoj-assistant==0.1.4 because these package versions have conflicting dependencies.

The conflict is caused by:
    khoj-assistant 0.1.4 depends on numpy==1.22.4
    khoj-assistant 0.1.3 depends on numpy==1.22.4
    khoj-assistant 0.1.2 depends on numpy==1.22.4
    khoj-assistant 0.1.0 depends on numpy==1.22.4

@debanjum
Copy link
Member

debanjum commented Sep 13, 2022

What command are you running to install khoj and which OS are you on? A bit strange that there are multiple, older versions of khoj that it's attempting to install. The recommended way to install khoj is by running pip install --upgrade khoj-assistant. The most recent version of khoj released is 0.1.9

@AtomicNess123
Copy link
Author

Thanks for the fast response. I am using the following:

pip install khoj-assistant

@debanjum
Copy link
Member

debanjum commented Sep 13, 2022 via email

@AtomicNess123
Copy link
Author

Thanks.

I get this:

§ pip uninstall khoj-assistant && pip install --no-cache-dir --upgrade khoj-assistant  127 ✘ 

WARNING: Skipping khoj-assistant as it is not installed.
Collecting khoj-assistant
  Downloading khoj_assistant-0.1.4-py3-none-any.whl (142 kB)
     |████████████████████████████████| 142 kB 216 kB/s 
Requirement already satisfied: pillow>=9.0.1 in ./opt/anaconda3/lib/python3.7/site-packages (from khoj-assistant) (9.0.1)
  Downloading khoj_assistant-0.1.3-py3-none-any.whl (142 kB)
     |████████████████████████████████| 142 kB 393 kB/s 
  Downloading khoj_assistant-0.1.2-py3-none-any.whl (142 kB)
     |████████████████████████████████| 142 kB 594 kB/s 
  Downloading khoj_assistant-0.1.0-py3-none-any.whl (51 kB)
     |████████████████████████████████| 51 kB 307 kB/s 
ERROR: Cannot install khoj-assistant==0.1.0, khoj-assistant==0.1.2, khoj-assistant==0.1.3 and khoj-assistant==0.1.4 because these package versions have conflicting dependencies.

The conflict is caused by:
    khoj-assistant 0.1.4 depends on numpy==1.22.4
    khoj-assistant 0.1.3 depends on numpy==1.22.4
    khoj-assistant 0.1.2 depends on numpy==1.22.4
    khoj-assistant 0.1.0 depends on numpy==1.22.4

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

@debanjum
Copy link
Member

debanjum commented Sep 13, 2022

Ah, based on those logs

  1. You're on an older python version (3.7). The newer versions of Khoj need python >= 3.8
  2. You're running an anaconda python. Are you running the pip install command from within a conda environment?

Suggested fixes:

  • You can fix 1. by upgrading the installed version of python on your system/anaconda environment
  • A different version of numpy is already installed than the one required by Khoj. Some ways to solve this are:
    1. Installing Khoj in a separate virtualenv or conda environment.
    2. Checking if it's safe to upgrade/downgrade numpy to 1.22.4 and manually doing that before trying to reinstall Khoj

@AtomicNess123
Copy link
Author

Thanks! I did:

git clone https://github.com/debanjum/khoj && cd khoj
conda env create -f config/environment.yml
conda activate khoj

Then I tried to run khoj by typing its name... but nothing happened.

@AtomicNess123
Copy link
Author

I tried to install khoj like this with khoj env active, and got this error:

§ pip install khoj-assistant
Traceback (most recent call last):
  File "/Users/User/opt/anaconda3/envs/khoj/bin/pip", line 6, in <module>
    from pip._internal.cli.main import main
  File "/Users/User/opt/anaconda3/envs/khoj/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/Users/User/opt/anaconda3/envs/khoj/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/Users/User/opt/anaconda3/envs/khoj/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "/Users/User/opt/anaconda3/envs/khoj/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 13, in <module>
    import importlib.util
  File "/Users/User/opt/anaconda3/lib/python3.7/importlib/__init__.py", line 51, in <module>
    _w_long = _bootstrap_external._w_long
AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'

@debanjum
Copy link
Member

   File "/Users/User/opt/anaconda3/envs/khoj/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 13, in <module>
    import importlib.util
  File "/Users/User/opt/anaconda3/lib/python3.7/importlib/__init__.py", line 51, in <module>

From the above error logs there seems to be an issue with your anaconda environment as both python3.7 and python3.8 libraries are being used in it.

Then I tried to run khoj by typing its name... but nothing happened.

The instructions to setup Khoj using (ana-)conda are here. According to that if you can start khoj by running python3 -m src.main -vv after you've setup the khoj conda environment. You shouldn't need to pip install khoj-assistant in the khoj conda environment.

  1. The khoj setup with conda instructions maybe stale as I haven't tested this flow for a while. So let me try the conda environment setup flow on my end to see if I can reproduce your issue. I'll get back about this by the end of this week

@debanjum
Copy link
Member

debanjum commented Dec 3, 2022

Updated instructions to setup Khoj with Conda in 676de23. Verified setup with Conda works on an Ubuntu 22.04 machine. Closing issue as no updates provided in a while. Feel free to re-open if required

@debanjum debanjum closed this as completed Dec 3, 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