4

I am using the request module in python, which has inda as a dependency.

I am keeping idna module inside request module but still it is not able to detect the inda module.

"/mnt/yarn/usercache/root/appcache/application_1522067995292_0020/container_1522067995292_0020_01_000001/slackclient.zip/slackclient/requests/packages.py", line 7, in ImportError: No module named idna

user3483203
  • 50,081
  • 9
  • 65
  • 94

2 Answers2

8

I had the same issue and strangely installing idna worked for me

$ pip install idna
Juanse
  • 1,194
  • 10
  • 16
-2

Use requirements.txt avoid these dependency mix-ups.

Firstly, when your code is working all good, do this

$ pip freeze > requirements.txt

This stores all the installed packages into the text file.

Now use requirements.txt file to install all modules wherever it runs hereafter

$ pip install -r requirements.txt

If needed, can upgrade your modules and check everything working cool and then update requirements.txt again.

When not mentioning the versions, usually the latest versions of the packages are fetched and installed. Some of the updates from dependency's dependency(inception) package might break.

Gokul
  • 788
  • 2
  • 12
  • 30
  • 2
    This information would only help if the program is already running properly and doesn't solve the problem of the dependency issue. – AlphaCR Feb 03 '20 at 03:43