Error with fst library python - python

I run Ubuntu and I followed all the instructions found here link ..
Where I try to test the fst library I get this error
>>> import fst
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/fst/__init__.py", line 1, in <module>
from fst._fst import EPSILON, EPSILON_ID, SymbolTable,\
ImportError: libfst.so.1: cannot open shared object file: No such file or directory
>>>

Sounds like the loader isn't looking for libraries in /usr/local/lib. Add that directory to your loader config in /etc/ld.so.conf* and run ldconfig.

Related

ImportError: No module named parse python/node js

I am calling .py file from node.js using npm i cmd-node on windows it is working well and executing my .py file from .js file, but when I am deploying it on the server giving following error:
Note: I am not importing parse anywhere, it may be part if any dependency.
python script cmd error: Error: Command failed: python covert_to_csv.py
Traceback (most recent call last):
File "covert_to_csv.py", line 1, in <module>
import tabula
File "/home/ubuntu/.local/lib/python2.7/site-packages/tabula/__init__.py", line 3, in <module>
from .wrapper import (
File "/home/ubuntu/.local/lib/python2.7/site-packages/tabula/wrapper.py", line 20, in <module>
from .file_util import localize_file
File "/home/ubuntu/.local/lib/python2.7/site-packages/tabula/file_util.py", line 3, in <module>
from urllib.parse import urlparse as parse_url
ImportError: No module named parse
You are probably using different versions of python on your local machine compared to the server. Make sure it is the same version as your local machine and it'll work.

Python error - “ImportError: No module named”

First of all this is what my directory looks like:
.:
ref.py main.py utility
./utility:
file_manip.py
When I execute main.py I get this error:
>>> python main.py
Traceback (most recent call last):
File "main.py", line 1, in <module>
import utility.file_manip as fm
ImportError: No module named utility.file_manip
I cannot for the life of me get to the bottom of this. Clearly utility.file_manip exists...
You need a blank __init__.py file in your utility directory in order for Python to see it as a package. See the tutorial.

Python SDK Install Guide on raspberry pi 3

I follow this page to install python SDK on raspberry pi 3. When i run "import naoqi" for Checking the installation of the Python SDK, I see this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "naoqi.py", line 7, in <module>
import qi
File "qi/__init__.py", line 72, in <module>
from _qi import Application as _Application
ImportError: ./_qi.so: cannot open shared object file: No such file or directory
I think i maybe set wronge path in this code:
export PYTHONPATH=${PYTHONPATH}:/path/to/python-sdk
My question is, what is /path/to/python-sdk ?
I set once this path:export PYTHONPATH=${PYTHONPATH}:/usr/include/python2.7 , and once set this path: export PYTHONPATH=${PYTHONPATH}:/home/nao/Downloads/Python-2.7.12
but i see that error again.
How must i do?
/path/to/python-sdk would be the absolute path to where you extracted pynaoqi-python-2.7-naoqi-x.x-linux32.tar.gz that you have to download.

ImportError: cannot import name pynestkernel

So I spend last night trying to install nest (and pynest) to use with PyNN, and I am currently stuck. When I try to import nest I get:
>>> import nest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nest/__init__.py", line 52, in <module>
from . import pynestkernel as _kernel
ImportError: cannot import name pynestkernel
However, when I make the make installcheck it passes all the pynest tests.
I am using OS x Yosemite, and I did a new install of python 2.7.9 using macport.
Tried:
easy_install python-nest
Now I am getting a new error.
Getting:
>>> import pyNN.nest as sim
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pyNN.nest as sim
File "/Library/Python/2.7/site-packages/pyNN/nest/__init__.py", line 13, in <module>
from pyNN.nest import simulator
File "/Library/Python/2.7/site-packages/pyNN/nest/simulator.py", line 500, in <module>
state = _State() # a Singleton, so only a single instance ever exists
File "/Library/Python/2.7/site-packages/pyNN/nest/simulator.py", line 60, in __init__
self._cache_num_processes = nest.GetKernelStatus()['num_processes'] # avoids blocking if only some nodes call num_processes
AttributeError: 'module' object has no attribute 'GetKernelStatus'
Try using setuptools to install nest with easy_install python-nest.
I am trying something similar, with the further goal of having it working with python 3. So far I used the following commands:
git clone https://github.com/nest/nest-simulator.git
cd nest-simulator
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/nest -DPYTHON_EXECUTABLE=/usr/local/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/include/python3.5m -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib .
make
make install
which runs without errors and I can happily run nest. Iam still having troubles running pyNN (see https://laurentperrinet.github.io/sciblog/posts/2016-06-01-compiling-and-using-pynn-%2B-nest-%2B-python3.html)

ImportError: Cannot open shared object file in Python

I am trying to run a python script which depends on other modules, however I ran into this:
bash-3.2$ PYTHONPATH=/my/path/tables-2.3.1/build/lib.linux-x86_64-2.7/ ./fastcluster.py
Traceback (most recent call last):
File "./fastcluster.py", line 5, in <module>
import tables
File "/my/path/tables-2.3.1/build/lib.linux-x86_64-2.7/tables/__init__.py", line 59, in <module>
from tables.utilsExtension import getPyTablesVersion, getHDF5Version
ImportError: libhdf5.so.7: cannot open shared object file: No such file or directory
bash-3.2$ ls libhdf5.so.7
libhdf5.so.7
bash-3.2$
No such file or directory libhdf5.so.7 ? But when I 'ls' it, it's there, right in my directory. So what's going on here?
The loader isn't looking there. Either put it in one of the standard locations for libraries, add the directory to the loader configuration, or set $LD_LIBRARY_PATH before running Python.

Categories