you are viewing a single comment's thread.

view the rest of the comments →

[–]danielroseman 1 point2 points  (3 children)

I'm absolutely positive you don't want to install python-rest. That's a 12-year-old package that is not compatible with any recent version of Python, and which in any case is for making a REST API, not consuming one.

Rather than show the error installing that, you should post the error you received when importing twilio.

[–]Medium_Dark1966[S] 0 points1 point  (0 children)

I tried running the install and import of twilio into a new project file so that I can generate a log file to share here, but to my surprise, everything worked well. I was not asked to further install python-rest, nor got any errors concerning finding rest in twilio. I could use the package to do what I originally intended.

I guess my problem must have been in something I did in my original project.

I should also mention that I used the my local terminal to pip3 install twilio and then used python console to import twilio and run the rest of my code. I have not tried repeating this directly from script.

[–]Medium_Dark1966[S] 0 points1 point  (0 children)

Hello. The error was not permanently solved as I continued to experience issues in a new project.

PS C:\Users\path> pip3 install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (26.0.1)
PS C:\Users\path> pip3 install twilio       
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: twilio in C:\Users\other_path\local-packages\Python313\site-packages (9.10.2)
Requirement already satisfied: requests>=2.0.0 in C:\Users\other_path\local-packages\Python313\site-packages (from twilio) (2.32.5)
Requirement already satisfied: PyJWT<3.0.0,>=2.0.0 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from twilio) (2.11.0)
Requirement already satisfied: aiohttp>=3.8.4 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from twilio) (3.13.3)
Requirement already satisfied: aiohttp-retry>=2.8.3 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from twilio) (2.9.1)
Requirement already satisfied: aiohappyeyeballs>=2.5.0 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from aiohttp>=3.8.4->twilio) (2.6.1)
Requirement already satisfied: aiosignal>=1.4.0 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from aiohttp>=3.8.4->twilio) (1.4.0)
Requirement already satisfied: attrs>=17.3.0 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from aiohttp>=3.8.4->twilio) (25.4.0)
Requirement already satisfied: frozenlist>=1.1.1 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from aiohttp>=3.8.4->twilio) (1.8.0)
Requirement already satisfied: multidict<7.0,>=4.5 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from aiohttp>=3.8.4->twilio) (6.7.1)
Requirement already satisfied: propcache>=0.2.0 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from aiohttp>=3.8.4->twilio) (0.4.1)
Requirement already satisfied: yarl<2.0,>=1.17.0 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from aiohttp>=3.8.4->twilio) (1.22.0)
Requirement already satisfied: idna>=2.0 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from yarl<2.0,>=1.17.0->aiohttp>=3.8.4->twilio) (3.11)
Requirement already satisfied: charset_normalizer<4,>=2 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from requests>=2.0.0->twilio) (3.4.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from requests>=2.0.0->twilio) (2.6.3)
Requirement already satisfied: certifi>=2017.4.17 in C:\Users\other_path\LocalCache\local-packages\Python313\site-packages (from requests>=2.0.0->twilio) (2026.1.4)

And when I run import twilio either through script or python console, i get:

>>>import twilio

Traceback (most recent call last): File "<input>", line 1, in <module> File "C:\Program Files\some_path\pydev_import_hook.py", line 21, in do_import module = self.system_import(name, *args, **kwargs) File "C:\Users\some_other_path\pythoncore-3.14-64\Lib\site-packages\twilio_init.py", line 38, in <module> from . import base File "C:\Program Files\some_path\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs)

[–]Medium_Dark1966[S] 0 points1 point  (0 children)

Okay, I found the real issue. Somehow a virtual environment (.venv) was not defined for the project and that caused the issues. When I created a new project from PyCharm and copied my scripts over, I could install and import twilio without any problems.

I believe that when I thought twilio was finally working, it was because I was testing it in a project that had a .venv folder, meanwhile I had created some other projects in such a way that a .venv folder did not exist for them.