easydiffusion icon indicating copy to clipboard operation
easydiffusion copied to clipboard

Dependency Issues on my Ubunutu 22.04 with conda: chardet, idna, requests,

Open peddanet opened this issue 1 year ago • 4 comments

On my ubunntu system 22.04 with python installed:

$ sudo update-alternatives --config python
[..]
There are 2 choices for the alternative python (providing /usr/local/bin/python).

  Selection    Path                 Priority   Status
------------------------------------------------------------
  0            /usr/bin/python3.7    2         auto mode
* 1            /usr/bin/python3.10   1         manual mode
  2            /usr/bin/python3.7    2         manual mode

Press <enter> to keep the current choice[*], or type selection number: 

I was not able to install the ./start.sh script. After some debugging, I found out that conda was lacking the package "chardef". However, when I tried to simply install it by first running (the probably unnecessary) commands:

$ micromamba activate /home/pwein/Downloads/easy-diffusion/installer_files/env
$ eval "$(micromamba shell hook --shell bash)" # as proposed after the first call because a parent process was working, that is why I assume this was potentially unnecessary

After that I try to resolve the dependency issuesin that macromamba environment (or whatever it is):

$ micromamba run -p /home/pwein/Downloads/easy-diffusion/installer_files/env pip3 install chardet
Collecting chardet
  Using cached chardet-5.2.0-py3-none-any.whl.metadata (3.4 kB)
Using cached chardet-5.2.0-py3-none-any.whl (199 kB)
Installing collected packages: chardet
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.
requests 2.25.1 requires chardet<5,>=3.0.2, but you have chardet 5.2.0 which is incompatible.
requests 2.25.1 requires idna<3,>=2.5, but you have idna 3.6 which is incompatible.
conda 23.9.0 requires requests<3,>=2.27.0, but you have requests 2.25.1 which is incompatible.
Successfully installed chardet-5.2.0

I had to specifically resolve those conflicts by

$ micromamba run -p /home/pwein/Downloads/easy-diffusion/installer_files/env pip3 install chardet\<5
Collecting chardet<5
  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.7/178.7 kB 3.2 MB/s eta 0:00:00
Installing collected packages: chardet
  Attempting uninstall: chardet
    Found existing installation: chardet 5.2.0
    Uninstalling chardet-5.2.0:
      Successfully uninstalled chardet-5.2.0
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.
requests 2.25.1 requires idna<3,>=2.5, but you have idna 3.6 which is incompatible.
conda 23.9.0 requires requests<3,>=2.27.0, but you have requests 2.25.1 which is incompatible.
Successfully installed chardet-4.0.0

$ micromamba run -p /home/pwein/Downloads/easy-diffusion/installer_files/env pip3 install idna\<3
Collecting idna<3
  Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 1.5 MB/s eta 0:00:00
Installing collected packages: idna
  Attempting uninstall: idna
    Found existing installation: idna 3.6
    Uninstalling idna-3.6:
      Successfully uninstalled idna-3.6
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.
conda 23.9.0 requires requests<3,>=2.27.0, but you have requests 2.25.1 which is incompatible.
Successfully installed idna-2.10

$ micromamba run -p /home/pwein/Downloads/easy-diffusion/installer_files/env pip3 install requests\<3
Requirement already satisfied: requests<3 in /home/pwein/.local/lib/python3.8/site-packages (2.25.1)
Requirement already satisfied: chardet<5,>=3.0.2 in ./installer_files/env/lib/python3.8/site-packages (from requests<3) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in ./installer_files/env/lib/python3.8/site-packages (from requests<3) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/pwein/.local/lib/python3.8/site-packages (from requests<3) (1.26.5)
Requirement already satisfied: certifi>=2017.4.17 in ./installer_files/env/lib/python3.8/site-packages (from requests<3) (2023.11.17)

$ micromamba run -p /home/pwein/Downloads/easy-diffusion/installer_files/env pip3 install requests\>=2.27.0
Collecting requests>=2.27.0
  Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in ./installer_files/env/lib/python3.8/site-packages (from requests>=2.27.0) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in ./installer_files/env/lib/python3.8/site-packages (from requests>=2.27.0) (2.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/pwein/.local/lib/python3.8/site-packages (from requests>=2.27.0) (1.26.5)
Requirement already satisfied: certifi>=2017.4.17 in ./installer_files/env/lib/python3.8/site-packages (from requests>=2.27.0) (2023.11.17)
Downloading requests-2.31.0-py3-none-any.whl (62 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 2.0 MB/s eta 0:00:00
Installing collected packages: requests
  Attempting uninstall: requests
    Found existing installation: requests 2.25.1
    Uninstalling requests-2.25.1:
      Successfully uninstalled requests-2.25.1
Successfully installed requests-2.31.0

After that I could proceed with the setup procedure flawlessly:

$ ./start.sh

On my other Ubuntu 22.04 laptop it runs flawlessly through. Whysoever! This bug issue is just to show a way of resolving these depenedencies, cause I am not so an "expert python programmer". Hope it might help.

Honestly I have only a vague idea why I had run into these issues:

  • computer was updated from Ubuntu 20.04 to 22.04
  • maybe I made a mistake when setting up python3.7 and 3.10 and/or their virtualenvs

peddanet avatar Dec 01 '23 22:12 peddanet