Why does Storm return 'ImportError: No module named os'? - apache-storm

I ran WordCountTopology example with Storm 0.8.2 but I am thrown an error as below:
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "storm-0.8.2/bin/storm", line 3, in <module>
import os
ImportError: No module named os
Looks like the error is not from the code but Storm environment. Any suggestions where I could look into would be of great help. Thanks.

I just checked the script in your question that is complaining locally, its a python script. You need the python os module for this to work.
I'm not sure why its not included already can you check and see of you have it installed.

Related

ModuleNotFoundError: No module named 'pymatting_aot.aot'

I'm on Windows and I work with python 3.8.
If I execute a python script where libraries need to be compiled, I will get the following error:
Failed to import ahead-of-time-compiled modules.
This is expected on first import.
Compiling modules and trying again.
This might take a minute.
Traceback (most recent call last):
File "C:\Users\...\env\lib\site-packages\pymatting_aot\cc.py", line 36, in <module>
import pymatting_aot.aot
ModuleNotFoundError: No module named 'pymatting_aot.aot
I already installed pymatting with pip.
Does anybody now a solution to solve this error?

JupyterNotebook: ModuleNotFoundError No Module named 'pyomo'

I have opened up a Jupyter Notebook and tried to import a module from pyomo but get the following:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-f9221793da50> in <module>
----> 1 from pyomo.environ import *
ModuleNotFoundError: No module named 'pyomo'
When I run this code in PyCharm however I get no problems with the module not being found. Can someone help me to understand why Jupyter is unable to find the module yet PyCharm is able to? If there is some information that I am missing that would be useful please let me know and I will update accordingly.
You have to install it. Put this line as the first line in jupyter notebook
!pip install pyomo
note that any missing module is installed like this.

error creating a new ec2 volume with ansible

I am using ansible 2.1.0. When I try to use ec2_vol to create a new volume, the error I get is 'Volume' object has not attribute 'encrypted'. The trace is:
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 593, in <module>
main()
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 583, in main
volume_info = get_volume_info(volume, state)
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 454, in get_volume_info
'encrypted': volume.encrypted,
AttributeError: 'Volume' object has no attribute 'encrypted'
Has anyone else seen this?
My issue was related to the fact that my version of python boto was not compatible with the ansible version I was using. Using apt-get in Ubuntu install version 2.20, and I think I need at least 2.30. So I used pip to install boto
pip install boto
An everything is fine now.

TypeError when downloading rapidsms using pip in django-tables2

I'm a total python newbie. I installed python 3.3.1 on a 32 bit windows 7 professional. I'm trying to install RapidSMS, and it should be as easy as "pip install rapidsms" and it does start the process, but it doesn't complete and I'm left with the below error message.
I've been trying to google it, but I haven't been able to find this specific problem, for the error I find fixes for people who have written the code themselves, and I haven't seen anyone mention this problem about rapidsms themselves. Since it stops in Django-tables, I wonder if I messed up that installation somehow or if there's a problem with the python version compatibility. I've used pip when installing some other software, so I don't think that's the problem.
So if anyone's encountered this error when installing pyhton packages or really have any idea what the cause might be I'd really appreciate it! (I also plan to post this in the RapidSMS mailing list when I get approved, but wanted to see if this was a more general problem that might have a fix.)
Downloading/unpacking django-tables2==0.13.0 (from rapidsms)
Running setup.py egg_info for package django-tables2
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\mhealth1\appdata\local\temp\pip-build-mhealth1\django-tables2\setup.py", line 7, in <module>
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
File "C:\Python33\lib\re.py", line 161, in search
return _compile(pattern, flags).search(string)
TypeError: can't use a string pattern on a bytes-like object
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\mhealth1\appdata\local\temp\pip-build-mhealth1\django-tables2\setup.py", line 7, in <module>
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
File "C:\Python33\lib\re.py", line 161, in search
return _compile(pattern, flags).search(string)
TypeError: can't use a string pattern on a bytes-like object
----------------------------------------
Command python setup.py egg_info failed with error code 1 in c:\users\mhealth1\a
ppdata\local\temp\pip-build-mhealth1\django-tables2
Storing complete log in C:\Users\mhealth1\pip\pip.log
Django-tables2 fails to install in Python3 because of the following code from line 7 of setup.py in the traceback:
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
This should work if the search pattern was a bytes object. A byte literal can be created by simply pre-pending the string literal with a b like the following:
version = re.search(b'__version__ = "(.+?)"', f.read()).group(1)
This is why Python is throwing a TypeError with the message "Can't use a string pattern on a bytes-like object". The file contents are being read in as bytes.
I don't think RapidSMS currently supports Python3 yet based on its list of environments that are tested. This can be seen in the tox environments list of the project seen here, in which only Python 2.6 and 2.7 are listed: https://github.com/rapidsms/rapidsms/blob/develop/tox.ini#L2
To solve the immediate problem, you'll want to install RapidSMS in a virtual environment with Python 2.6 or 2.7. The documentation for RapidSMS describes virtual environment setup briefly here: http://www.rapidsms.org/en/develop/topics/virtualenv.html
You'll want to install Python 2.6 or 2.7 on your system and specify which Python for the virtualenv to use, using the -p or --python argument. The following is taken from the RapidSMS docs linked above, but ammended to specify using Python 2.7:
mkvirtualenv --distribute --no-site-packages rapidsms --python=python2.7

Error for syncdb while installing openstack

I've seen other people say they have this error from openstack also, but I have not been able to find any kind of answer.
I followed the website http://uksysadmin.wordpress.com/2011/02/17/ for the base installation of openstack, and this seems to work correctly.
Now I'm following the website http://wiki.openstack.org/OpenStackDashboard to install openstack Dashboard and when I get to the command "tools/with_venv.sh dashboard/manage.py syncdb" I get this error:
ERROR:root:No module named local.local_settings
Traceback (most recent call last):
File "/home/harlan/horizon/openstack-dashboard/dashboard/settings.py", line 126, in <module>
from local.local_settings import *
ImportError: No module named local.local_settings
ERROR:root:No module named local.local_settings
Traceback (most recent call last):
File "/home/harlan/horizon/openstack-dashboard/dashboard/../dashboard/settings.py", line 126, in <module>
from local.local_settings import *
ImportError: No module named local.local_settings
Error: No module named horizon.dashboards.settings
I'm doing the installation on Ubuntu 11.10 Server.
It looks like it's not finding your local_settings.py file, make sure you did this step (documented on the wiki):
$ cd horizon/openstack-dashboard
$ cp local/local_settings.py.example local/local_settings.py
As an aside, the simplest way to get up and running with OpenStack is to use DevStack.

Resources