twilio.rest missing from twilio python module version 2.0.8? - twilio

The Twilio python quickstart guide says to use a submodule called twilio.rest .
But after installing the twilio module today via sudo pip install twilio, which installed version 2.0.8, there appears to be no module (or object) called "rest" within the twilio module.
Where is twilio.rest?

There are two things you should check.
First, if you already have a package installed with pip, running pip install package-name will NOT upgrade the package. To upgrade the package to the newest version, run
pip install --upgrade twilio
Second, we often see this error occur because people named the file containing their Twilio code twilio.py. This means that trying to import twilio.rest will fail because Python is looking in the twilio.py file for the .rest module. To resolve the problem use a different filename.
If you have more problems with the twilio module and ImportError messages, there is a full set of documentation here: http://readthedocs.org/docs/twilio-python/en/latest/faq.html#importerror-messages

I had the same symptom but my problem was I named my view handler twilio.py. That caused a conflict with twilio library. Just name your py file something else like phone.py.

Related

module 'numpy' has no attribute 'object'

I am getting below error when running mlflow app
raise AttributeError("module {!r} has no attribute " AttributeError:
module 'numpy' has no attribute 'object'
Can someone help me with this
Since version 1.24 of numpy, np.object is deprecated, and needs to be replaced with object (cf. numpy release notes).
You either need to update this in your code, or another package you're using needs to be updated (not possible to answer without more information).
One (dirty) workaround for now would be to fix your numpy version to the last version still supporting np.object with pip install numpy==1.23.4
This error sometime occurs when an older version of numpy is been imported by other package, which does not have the 'object' attribute on it.
You can try the following:
Solution 1: pip install --upgrade numpy
Solution 2: Re-install numpy
pip uninstall numpy
pip install numpy
Solution 3 (if you are using conda package manager): conda update numpy
Last but not least, in case if you are running multiple version of python on your machine, you have to check which version of python your MLflow is using.
You can check that by running which pythonin command line and then make sure that the required version of numpy is installed.
The Python "AttributeError module 'numpy' has no attribute 'object'" occurs when we have a local file named numpy.py and try to import it from the numpy module. To solve the error, make sure to rename any local files named numpy.py.
Another way: Check that the file you are running was named numpy.py. If you have this problem check to make sure you don't have a file in the directory called numpy.py.
In most cases, rename your project local file numpy.py and delete numpy.pyc if it exists, then your project file script will run without an attribute error.
Easy way to check is to move the file with the import statement to a different directory and try running it.
Please check whether you have installed a newer pip updated numpy version.
Also check the similar SO for more information.

No Module Named PyQt5 and Pyside2 Error While Trying to open rqt

I've been trying to use the ROS(Robot Operating System) using this page:
Tutorial page
In the link it makes you use turtle sim it seemed to work fine with me without any errors.
In the 4th step(install rqt),i get this error:
`INPUT: RQT
OUTPUT: ImportError for 'pyqt': No module named 'PyQt5'
ModuleNotFoundError: No module named 'PyQt5'
ModuleNotFoundError: No module named 'PySide2'`
There was more lines of error but it seemed irrelevant to me because it only says file names.
I'm using python version 3.8.3 and qt version 5.12.12.
I downloaded the qt manually in their website.Didn't use:
pip install PyQt5
And i don't exactly remember now but someone said something about local files of pyhton but i had none of them:
screenshot of C:\Users\Boran\AppData\Local\Programs
It supposed to be Pyhton files in here.
Also there is no problem about python it works fine and i used talker and listener(pyhton coded applications of ROS.) and they worked fine.
I solved the problem by installing graphviz.It appears that to run rqt i had to install graphviz.

How to install librabbitmq in App Engine Google Cloud Platform

I've been trying to install librabbitmq in App Engine GCP without any luck. https://github.com/celery/librabbitmq
All other pip packages install properly if they are in the requirements.txt via my yml file, however, this package does not work (missing compiler, gcc, etc).
How do you install this in App Engine?
I've tried both in Python2 and Python3 just in case, works ok for me.
Try to require a specific version,maybe that's your issue?
Here you have a simple requirements.txt, if that doesn't solve it give us more info.
Try this:
Flask==1.0.2
rabbitmq==0.2.0

Electron - How can I install or use a third party dependency like a brew or apt-get package in my app?

Currently I want to build a desktop app which is using a third party package that can be installed trough apt-get or brew but I do not know how to inject this dependency on my electron app.
I want to avoid ask the user to install this dependency before of use my app like "Hey to use this app you should have the Package A installed.".
Thanks for the help.
You can do it in the installer (Preferred). For example, You can create a debian for your app.
In the makefile of the debian, you can check if module is present or not, if not install.
OR
You can do it in the app first boot,
You can check if the user's system already has that module or not using child_process (spawning a terminal & executing a cmd to check if the module is present) or by writing a native node module to do the same.
If the module is not present, you can use child_process module to execute the command to install that module.

Kivy Garden fails with error

I have downloaded the prepackaged Kivy zip file onto a Windows 8.1 machine and installed Kivy-Garden using pip (after running kivy.bat). However, I have been unable to successfully use Kivy-Garden. I have attempted the following commands:
garden install graph
garden list
However, neither of them work. They both result in the following error:
Traceback (most recent call last):
File "c:\kivy\Python27\Scripts\garden", line 5, in <module>
pkg_resources.run_script('Kivy-Garden==0.1.1', 'garden')
File "C:\Python27\lib\site-packages\pkg_resources.py", line 483, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1335, in run_script
raise ResolutionError("No script named %r" % script_name)
pkg_resources.ResolutionError: No script named 'garden'
Does this indicate a bad installation? How might I fix it?
Kivy for windows comes in a bundle with all the prerequisites to run, since some are hard to install in windows, so it's not using you installed python.
You should go to your kivy installation folder, inside you'll find the python folder, inside is the python descriptor used for kivy, you can run that python exe, or use pip or easy install (i don't remember if both), like an extra advice i could saw to use PyCharm to program, it's easy to install the python modules and code, i have it myself with SqlAlchemy instaled from the PyCharm Gui (previous config here Configure PyCharm and Kivy).
In the other hand you can configure kivy to run with your installed python (instructions here Kivy with an installed Python in Windows) i haven't tried myself since i use the same python included in kivy with no problems
I never figured out why pip wouldn't work, but I found a workaround.
Just download the package from pypi and run setup.py:
https://pypi.python.org/pypi/kivy-garden/0.1.1
The only workaround I've found that works is to manually install flowers into the kivy garden folder. Ceremcem has a great explanation of it here: filebrowser error in windows for kivy
Also I found I had to explicitly use pip2 for pip to work.

Resources