I have Redhawk 1.9 loaded on a 32-bit CentOS 5 virtual machine. I am trying to run the Redhawk HelloWorld component described here: http://redhawksdr.github.io/Documentation/mainch3.html. I am able to launch and start the component in the eclipse sandbox. I cannot run it from Python though. I get the following error.
Python 2.7.2 (default, Feb 27 2012, 16:40:29)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ossie.utils import sb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/redhawk/core/lib/python/ossie/utils/sb/__init__.py", line 115, in <module>
from domainless import *
File "/usr/local/redhawk/core/lib/python/ossie/utils/sb/domainless.py", line 102, in <module>
from omniORB import CORBA, any
ImportError: No module named omniORB
>>>
Any ideas why it will not work?
You'll probably have to set your PYTHONPATH manually to include the appropriate directory. It looks like Eclipse is doing that for you.
Try running your example as root. If you can successfully run as root, then you have a permission problem on your directories or files. How do you identify the files that have the incorrect permission ? I ran the following command,
strace -o test.out python -c "from ossie.utils import sb"
This command will write the output to test.out. Look for the string "denied", which will identify the file that has the incorrect file permission.
Related
Trying to use pyarrow to access hdfs file and not able to get it working, below is the code, thank you very much in advance.
[rxie#cedgedev03 code]$ python
Python 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
import pyarrow
import os
os.environ["JAVA_HOME"]="/usr/java/jdk1.8.0_121"
from pyarrow import hdfs
fs = hdfs.connect()
Traceback (most recent call last): File "", line 1, in File
"/opt/cloudera/parcels/Anaconda/lib/python2.7/site-packages/pyarrow/hdfs.py",
line 183, in connect extra_conf=extra_conf) File
"/opt/cloudera/parcels/Anaconda/lib/python2.7/site-packages/pyarrow/hdfs.py",
line 37, in init self._connect(host, port, user, kerb_ticket, driver,
extra_conf) File "pyarrow/io-hdfs.pxi", line 89, in
pyarrow.lib.HadoopFileSystem._connect File "pyarrow/error.pxi", line
83, in pyarrow.lib.check_status pyarrow.lib.ArrowIOError: Unable to
load libhdfs
You might need to manually locate this file and specify it with the ARROW_LIBHDFS_DIR environmental variable.
Find the file using locate -l 1 libhdfs.so. In my case, the file is located under /opt/mapr/hadoop/hadoop-0.20.2/c++/Linux-amd64-64/lib.
Then, restart your Python REPL with the environment variable ARROW_LIBHDFS_DIR set to this path. In my case, my command looks like:
ARROW_LIBHDFS_DIR=/opt/mapr/hadoop/hadoop-0.20.2/c++/Linux-amd64-64/lib python
This should solve this particular problem.
(Inspired by https://gist.github.com/priancho/357022fbe63fae8b097a563e43dd885b)
I have recently upgraded the system to 16.04 Gnome. The most troubling thing that I am facing is that I cannot import a NAOqi library for my work. The python version of this library was pretty simple to set-up. One just has to untar the file and then enter a path variable called PYTHONPATH pointing to this library and it worked like a charm in 14.04. Now since upgrade I am facing:
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import naoqi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dell/nao_sdk/pynaoqi/naoqi.py", line 7, in <module>
import qi
File "/home/dell/nao_sdk/pynaoqi/qi/__init__.py", line 72, in <module>
from _qi import Application as _Application
ImportError: libqipython.so: cannot open shared object file: No such file or directory
If I add a path variable:
export LD_LIBRARY_PATH=:/home/dell/nao_sdk/pynaoqi/
The error changes to:
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import naoqi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dell/nao_sdk/pynaoqi/naoqi.py", line 7, in <module>
import qi
File "/home/dell/nao_sdk/pynaoqi/qi/__init__.py", line 72, in <module>
from _qi import Application as _Application
ImportError: libboost_regex.so.1.55.0: cannot open shared object file: No such file or directory
Please help me what should I do to get it working? I have also used python 2.6.9 but same error occurs with error below.
ImportError: libboost_python.so.1.55.0: cannot open shared object file: No such file or directory
Installing libboost1.55 did the trick. 16.04 comes with libboost1.58 but naoqi is not yet compatible with it. Manual installation of libboost1.55 solved the import error.
I use the code from here:
https://github.com/Jefferson-Henrique/GetOldTweets-python
And every time I try to import the file folder, import got, it will raise:
Traceback (most recent call last):
File "C:\Users\USER\Desktop\python\get_old_tweet\Main.py", line 1, in <module>
import got
File "C:\Users\USER\Desktop\python\get_old_tweet\got\__init__.py", line 1, in <module>
import models
ImportError: No module named 'models'
I have check the file and been pretty sure that they do have the file folder called models
And the file folder also contains __init__.py file.
So it should work well..
I have no idea how it doesn't work. Please help me!
Which version of Python do you use?
The library https://github.com/Jefferson-Henrique/GetOldTweets-python is written with Python 2.
Python 2 and Python 3 have a bit different behavior with import: https://www.python.org/dev/peps/pep-0404/#imports
Let me share example of import regarding your case:
$ python3
Python 3.5.0 |Anaconda 2.4.0 (x86_64)| (default, Oct 20 2015, 14:39:26)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import got
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/viach/Downloads/GetOldTweets-python-master/got/__init__.py", line 1, in <module>
import models
ImportError: No module named 'models'
>>> ^C
KeyboardInterrupt
$ python2
Python 2.7.10 (default, Aug 22 2015, 20:33:39)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import got
So, quick solution for you: use Python 2 in your app which depends on GetOldTweets-python.
Python only searches its default library paths by default (including the running script path). So you need to put them in Python default library paths or append your module path to those paths.
To append the path array:
>>> import sys
>>> sys.path.append("path/to/the_module")
>>> import the_module
If above solution doesn't worked, try:
>>> from models import got
It depends on where you are importing from. In the repository you proved a link to models is a subfolder of got. Try this:
from got import models
You can use a Python3-compatible fork of GetOldTweets-python:
https://github.com/Mottl/GetOldTweets-python3
I have a python script for auto mailing when there is a commit in svn, but when i run the script it gives following error :
Traceback (most recent call last):
File "E:\AutoSms-Svn-Repo\test-repo-is\hooks\mailer.py", line 41, in <module>
import svn.fs
File "C:\Python25\Lib\site-packages\svn\fs.py", line 19, in <module>
from libsvn.fs import *
File "C:\Python25\Lib\site-packages\libsvn\fs.py", line 5, in <module>
import _fs
ImportError: DLL load failed: The specified module could not be found.
I even added required path variables for dependent dlls and python path
but still i get this message, even from command prompt
Thanks in advance
I got the same problem instaling subversion under Windows 7 for Python 2.7.
The solution is simple and has been tested. (but hard work to find and analize)
Download and install binaries from Subversion
Make sure thet binaries folder (default: c:\Program Files (x86)\subversion\bin) is in your PATH system
Download Python files from site mentioned in point 1 ( Subversion )
Extract libsvn and svn into Python's site-packages folder
Open cmd (Window's command line console) and type: python. Then try to import svn module.
It should looks like (no error occured):
C:\>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from svn import core
>>>
I have a problem, Python doesn't loads the dynamic c library _fileio
~ $ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Could not open PYTHONSTARTUP
IOError: [Errno 2] No such file or directory: '/home/sven/.pythonrc'
>>> import io
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/io.py", line 63, in <module>
import _fileio
ImportError: No module named _fileio
>>>
~ $ locate _fileio
/usr/lib/python2.6/lib-dynload/_fileio.so
~ $ echo $PYTHONPATH
/usr/lib/python2.6/
greetings Sven
Seems like an environment issue, stemming from this line:
IOError: [Errno 2] No such file or directory: '/home/sven/.pythonrc'
To solve this, find .pythonrc and make sure the PYTHONSTARTUP environment variable in your .bashrc file points to this file location. If it is in fact correct, try using the hardcoded path to /home/sven/.pythonrc rather than something such as ~/.pythonrc.
Also, if I remember right, .pythonrc should actually be a *.py file, but that might vary depending on the distribution.
I had this line in my zshrc file
export PYTHONPATH=/usr/lib/python2.6
but ubuntu uses per default Python 2.7.1
As I deleted the line from above, the error message dissapeared.
Sorry, my fault.