ImportError: No module named twilio.rest - python

I realize this question has been posted before (1, 2), but none of the posted solutions have worked for me.
I've correctly installed twilio in python 2.7.0 using pip install
I've checked to make sure none of the projects are named twilio.py
I've tried uninstalling and re-installing, confirmed twilio version 5.7.0
tried relaunching IDLE
I'm still getting the "ImportError: No module named twilio.rest" message. What can I do?

You need to make sure that your pip command that you are running is from the right path, just as described in their FAQ
This one worked for me:
/usr/local/bin/pip install twilio

Related

ImportError: DLL load failed while importing shell

Importing winshell (version 0.6) causes the following error:
>>> import winshell
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python39\lib\site-packages\winshell.py", line 32, in <module>
from win32com.shell import shell, shellcon
ImportError: DLL load failed while importing shell: The specified procedure could not be found.
I finally managed to get Anaconda to start working by executing the line:
pip install pywin32==300
I had to do it twice, because the first time it went for 301, not 300. The second time then dropped it to 300. This was from the Anaconda for Windows installer downloaded just two days ago from the Anaconda website and doing a "clean install"!
What a fiasco!
Until that point, NOTHING really worked. Almost every important command within Anaconda would fail with the Win32com error, and Navigator would not even start. Apparently the latest version of pywin32 is 304, but it doesn't work either. Is anyone looking into this? For a newbie like me, this is a very bad look for Anaconda as a tool! I was on the brink of simply giving up when I literally stumbled onto this thread.
Note that it has been MONTHS between my post and the one before mine. I'd say that this has probably caused a lot of people to simply give up (assuming that there are many who actually try to install this on Windows per month, that is).
I've had similar in the past,was about to give up on Anaconda.
Here's the solution
Apparently the wrong version of pywin32 gets installed.
I had the installed version 301 and after downgrading to 228 with pip install --upgrade pywin32==228 everything just started working.
Try pip install --upgrade pywin32==228
This should resolve the issue
Version 300 of pywin32 solved this issue for me! Check this other question for more info
Had the same issue with Conda and librosa in Python 3.9.
Librosa references from win32com.shell import shellcon,shell, which was causing the same error you received.
Installing pywin32 via conda fixed the error for me:
conda install -c conda-forge librosa
I ran into this issue when trying to get Anaconda to run at all on a new installation. I followed Alex T's recommendation to install version 300 of pywin32. Like him, I had to run it twice because it first installed version 302 for some reason. After running it the second time I can now run conda commands in that environment
pip install pywin32==300
My simple solution is to install an Older version of Anaconda. This worked perfectly for me. I installed Anaconda3-2021.11-Windows-x86 version.
The Newer Version of Anaconda has some problems with pywin32. I first tried the command :
pip install --upgrade pywin32==228
but It didn't workd for me. Installing an older version finally solved the problem of anaconda navigator not launching.

Pip installed a module I want to use, but still getting "module not found" error

I am trying to use the Python module Gdal. I have run pip install gdal and I recieve the message
Requirement already satisfied: gdal in c:\users\willy\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (3.3.1)
and yet when I run import gdal in my Python IDE (I use Spyder), I still get the error no module named gdal
You need to tell Spyder which Python interpreter to use. Point it to the one you're installing the package for, as it seems that it's using a different one.
https://docs.spyder-ide.org/current/faq.html#using-existing-environment
From the documentation it seems you have to call:
from osgeo import gdal
See here
Answer is here in Spyder docs: https://docs.spyder-ide.org/5/faq.html#using-packages-installer
Don't try to use pip install and expect it to work in Spyder. Follow these instructions

Having issue importing requests and I assume it's my python runtime not being set correctly

Probably stupidly I tried to install the latest version of Python, in this case using the download from python site, but after doing that I was then getting python still running on the previous version python-3.6. I'm on OSX and was using sublime.
So I have been trying to work out how to update it to use the newest version. I've followed; https://opensource.com/article/19/5/python-3-default-mac.
All of the responses to queries now point to the python-3.9.5 version. So that's great and my runtime is using that. However after installing the requests using pip install I get the following error when running.
import requests
ModuleNotFoundError: No module named 'requests'''
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
I stumbled upon Modules are installed using pip on OSX but not found when importing which I have been trying to work through.
I have been able to run the import command successfully in terminal, however it's intermittent as I've tried again and it's broken, so I'm lost. I'm running it something trying to run the python3.6 version, which after updating I followed these instructions to remove when I have uninstalled that from my mac https://www.macupdate.com/app/mac/5880/python/uninstall.
If there is any ideas, would love some help, mainly to try and tell me what that error message is telling me.
In particular, what does this mean?
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/
I should clarify too; when I run 'pip list'
I see
requests 2.25.1
Assuming that you are not installing requests package properly, and assuming your python executable is named python:
python -m pip install requests
If however, your python executable is named something else instead, e.g. python3, replace python with that name:
python3 -m pip install requests

no module named tensorflow

I installed tensorflow CPU version in windows as mentined on their official page.
It got installed successfully but giving error while I import the library.
Output for pip freeze also shows it's present:
spyder==3.1.2
SQLAlchemy==1.1.5
statsmodels==0.6.1
sympy==1.0
tables==3.2.2
tensorflow==1.0.1
toolz==0.8.2
tornado==4.4.2
traitlets==4.3.1
Using anaconda.
If you have python 2.X installed along with a Python 3.X do pip(version) example; pip3 instead of pip. I had a similar problem so i had a look around and someone said do pip3.6.1 but it spewed out an error so a few trys later pip3 worked. If not idk whats happening

Can't import flask because werkzeug

When I use from flask import *, I get the error
ImportError: No module named werkzeug.exceptions
However, when I do pip freeze, I can see that Werkzeug==0.11.11 is indeed installed. How can I fix this?
I am asumming, that the wrong version of Werkzeug was installed in the fist place. This usually happens, when you have 2 versions of python installed, and you use 'pip' for installing dependancies rather than using 'pip3'. Hope this helped!
I had this problem with Yocto while installing python-flask from: http://git.yoctoproject.org/git/meta-virtualization.
The solution was to manually add python-werkzeug to my yocto image as well. I suspect that python-flask should depend upon python-werkzeug. Additionally, I had to add python-jinja2 as well to the image.
I faced same issue.
I got this error when working in python virtual environment.
I had to deactivate virtual environment. Then go to root user and install werkzeug using pip. After that it works in virtual environment.
I had installed quite a few flask packages only with pip, but that was not enough, I also got the error ImportError: No module named werkzeug.exceptions.
The hint of the other answer, mentioning python-flask and python-werkzeug, brought the main idea. In my case, the solution was to apt-get install python-flask. It installed werkzeug as a dependency and the error was gone.

Categories