Isaac
Isaac

Reputation: 180

No module named 'requests_toolbelt'

So, I'm trying to upload my python app to heroku but when I use a script with 'requests_toolbelt' it says is not found.

Here my log:

Traceback (most recent call last):
  File "girl.py", line 12, in <module>
    from Coffe import CoffeAPI
  File "/app/CoffeAPI/__init__.py", line 29, in <module>
    from requests_toolbelt import MultipartEncoder
ImportError: No module named 'requests_toolbelt'

Here my requeriments.txt:

requests-toolbelt==0.7.1
moviepy==0.2.2.11
requests==2.13.0

Do I need an specific buildpack to run 'requests_toolbelt'?

Upvotes: 12

Views: 35705

Answers (3)

Berci
Berci

Reputation: 594

I had the same issue, and my solution was that

the package was installed by root user

and after changing the access properties of the files, it worked fine.
The command I specifically issued (on ubuntu-like system) was:

sudo chown $USER.$USER -R ~/.local/lib/python3.7/site-packages/

Upvotes: 3

Pawan
Pawan

Reputation: 151

Try installing requests-toolbelt. Use below command to do that.

# pip install requests-toolbelt

Upvotes: 12

Julian Silvestri
Julian Silvestri

Reputation: 2037

Have you tried to install the package using your command line? Navigate your command line to the path where you have python installed:

>path\easy_install.exe requests_toolbelt

or

>path\easy_install.exe requests-toolbelt

or

>path\python -m pip install requests_toolbelt

Hopefully this helps you

Upvotes: 5

Related Questions