When compiling libjingle, on running the 'hammer.sh' on the swtoolkit,
i get the following import error,
root#den-pc:~/tejesh/libjingle-0.6.14/talk# sh ../../swtoolkit/hammer.sh
Traceback (most recent call last):
File "../../swtoolkit/wrapper.py", line 44, in <module>
import SCons.Script
ImportError: No module named SCons.Script
so how do i fix this import error... any suggestions?
i already setup the environment variables for scons (SCONS_DIR) and have all the libraries installed..
If you have SCons correctly installed, then it sounds like a problem with python not being able to find it. In addition to the SCONS_DIR environment variable, try including the SCons location in the PYTHONPATH environment variable.
when you install scons,in the README file,you can use:
# python setup.py install --standalone-lib
that can make scons modules into pythonpath.
Related
I am getting the following error when trying run the example hello_world.py.
Traceback (most recent call last):
File "/usr/share/bcc/examples/hello_world.py", line 9, in <module>
from bcc import BPF
ImportError: cannot import name BPF
I installed bcc from source (link).
I also installed both the python bcc bindings packages, python-bcc and python3-bcc but no luck.
I am running Ubuntu 18.04 and kernel version 4.15.0-117-generic.
What am I missing here?
In ubuntu 20.04, I execute the following command to fix it.
sudo apt-get install bpfcc-tools linux-headers-$(uname -r)
I got the issue. I was using the pyenv to manage my python versions, so the python was looking files in the wrong locations.
$ python -c 'import site; print(site.getsitepackages())'
['/home/sagar/.pyenv/versions/3.6.6/lib/python3.6/site-packages']
I tried with a python3 command, which was not installed by pyenv and I don't get the above error.
I'm confused by how I'm supposed to install/use new modules in PythonAnywhere.
For instance, I installed the module ephem in Bash console with
pip3.6 install --user ephem
Everything went alright. If I run the above command again it says;
Looking in links: /usr/share/pip-wheels
Requirement already satisfied: ephem in ./.local/lib/python3.6/site-packages (3.7.7.0)
However, when I try to use it in my script I get:
Traceback (most recent call last): File "/home/krollibrius/montaulieu.py", line 7, in <module> import ephem ModuleNotFoundError: No module named 'ephem'
Can someone help?
Perhaps you used the wrong python version, try adding
import sys
print(sys.version)
to your script. I find that most of the time I install packages to the wrong version.
Another solution could be to use the command pythonwithversionnumber -m pip install --user ephem. Replace pythonwithversionnumber with the command you used to run your script
Is there a way where I can import both opencv2 and rospy successfully in python3. Because right now I get an error.
Traceback (most recent call last): File "", line 1, in ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type
removing the line "source /opt/ros/kinetic/setup.bash" from my bash file solves the problem of importing opencv but now I cant import rospy
This happens since ROS creates its own open cv ,which is compatible with python2 only.To solve this
You need to rename the Cv of Ros located at /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so to something else, example cv_renamed.so and then you should be able to import it
Since Ros cannot coexist for python2 and python3 , It is recommended to have a virtual environment(conda,virtual env)
I have followed the tutorial for installing Geodjango on my Ubuntu 14.04. I am using Django 1.10 and Python 3.5, postgres-9.6 and postgis 2.3.
I have checked here and here, but found no solution.
In a newly installed ubuntu 14.04 Virtual Machine, it worked.
But in my installation, when I tried making migrations, I got:
OSError: /usr/lib/libgdal.so.1: undefined symbol: sqlite3_column_table_name
Investigating a bit further, I tried simply:
from django.contrib.gis import gdal
And got:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pv/anaconda3/envs/dj110py35/lib/python3.5/site-packages/django/contrib/gis/gdal/__init__.py", line 49, in <module>
from django.contrib.gis.gdal.driver import Driver # NOQA
File "/home/pv/anaconda3/envs/dj110py35/lib/python3.5/site-packages/django/contrib/gis/gdal/driver.py", line 5, in <module>
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
File "/home/pv/anaconda3/envs/dj110py35/lib/python3.5/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 9, in <module>
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
File "/home/pv/anaconda3/envs/dj110py35/lib/python3.5/site-packages/django/contrib/gis/gdal/libgdal.py", line 48, in <module>
lgdal = CDLL(lib_path)
File "/home/pv/anaconda3/envs/dj110py35/lib/python3.5/ctypes/__init__.py", line 347, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libgdal.so.1: undefined symbol: sqlite3_column_table_name
Is there any suggestions on how I could repair my setup?
UPDATE
It seems to be a problema with my conda environment. When I started using a pip virtualenv, the problem did not arise anymore. I am not answering the question, because I could not find the solution, only a workaround. But rebuilding the environment with pip virtualenv works.
In conda environment: conda install -c conda-forge gdal=2.2.1
In django settings.py:
GDAL_LIBRARY_PATH = '<HOME>/anaconda3/envs/<env_name>/lib/libgdal.so'
I was having this issue as well and the specifying
GDAL_LIBRARY_PATH = <HOME>/anaconda3/envs/<env_name>/lib/libgdal.so
(in project.settings or os.environ.setdefault) led to
libicui18n.so.56: cannot open shared object file: No such file or directory.
The fix that worked for me was to upgrade icu:
conda install -c conda-forge icu=58
Upgrading icu lead to some changes in other package versions as well (qt downgraded from 5.6.2-4 to 5.6.2-3, the rest upgraded).
I simply run under my conda environment:
conda install gdal
Guy de Carufel's solution did not work for me, though he pointed to a correct direction, thanks
Have you built SQLite from source? Then, you forgot to enable Column metadata. Recompile SQLite with
CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" ./configure
make
sudo make install
Have fun using the cutting edge SQLite.
Reference - https://www.sqlite.org/compile.html#enable_column_metadata
Traceback (most recent call last):
File "setup.py", line 26, in <module>
from distutils.core import setup, Extension, Command
ImportError: No module named distutils.core
I get this error when installing ctypes.py on openwrt. Unfortunately, I cannot find the download link to the setup for distutils.core.
Can someone point me to it?
distutils ships in Python’s standard libary. Some operating systems think it’s not a regular module but only interesting for developers, so they move it to a python-devel package together with C headers, config files and co. https://dev.openwrt.org/ticket/793 tells me that this is the case for OpenWRT: you need to install python-dev to get distutils installed.
While logged in to openwrt try:
opkg update
opkg install distribute