I'm trying to install Twisted on a small board running a version of OpenWRT (chaos calmer). I'm running it step by step so I could track and install the missing packages on the device. Last error was:
ImportError: No module named unicodedata
I have installed all the packages offered for python by the vendor, tried find and grep in my Desktop's /usr/lib/python2.7/ also tried
python -v
on my desktop to find the module but haven't been able to locate it. Seems like it's an internal package.
How can I install unicodedata on the device?
The file unicodedata.so is provided in the python-codecs package. A x86_64 version is available so presumably it's also available for other architectures.
You should be able to determine that with:
$ opkg search '*/unicodedata.so'
or possibly
$ opkg whatprovides '*/unicodedata.so'
Related
I need to use the sksparse.chomod package however my pycharm does not let me install it as it can't seem to find it.
I found the sksparse package on github and downloaded it but I do not know how to add a package downloaded from the internet into a conda environment. So, my first question would be can you download a package from github and add it to your conda environment, and how do you do this?
As I did not know how to do the above I instead saved the package within my project and thought I could simply import sksparse.cholmod. However, the line in my code that says import sksparse.cholmod as sks has no errors with it, so I assumed that meant this was ok, but when I try to run my file I get this error:
import sksparse.cholmod as sks
ModuleNotFoundError: No module named 'sksparse.cholmod'
If I have downloaded the package into my project why can't it be found, yet there are no errors when importing?
The cholmod file is a pyx file which I've been told should not be a problem.
Please could anyone help, I am reasonably new to python and I am looking for a straight forward solution that won't be time consuming.
It was an issue with windows, I was able to fix this using the instructions on this link
https://github.com/EmJay276/scikit-sparse
We must follow these steps precisely:
(This was tested with a Anaconda 3 installation and Python 3.7)
Install these requirements in order:
'''
conda install -c conda-forge numpy - tested with v1.19.1
conda install -c anaconda scipy - tested with v1.5.0
conda install -c conda-forge cython - tested with v0.29.21
conda install -c conda-forge suitesparse - tested with v5.4.0
'''
Download Microsoft Build Tools for C++ from https://visualstudio.microsoft.com/de/visual-cpp-build-tools/ (tested with 2019, should work with 2015 or newer)
Install Visual Studio Build Tools
Choose Workloads
Check "C++ Buildtools"
Keep standard settings
Run ''' pip install git+https://github.com/EmJay276/scikit-sparse '''
Test ''' from sksparse.cholmod import cholesky '''
Use all the versions stated for numpy etc, however with scipy I installed the latest version and it worked fine.
I'm using the "import ldap" in a python code. This is on a windows 10 machine.
I installed the python-ldap module
pip3 install python-ldap
Installed the dependencies based on the instructions at Python Can't install packages
Also resolved all the pip deployment issues based on Installing python-ldap in a virtualenv on Windows
I'm now getting the following error when executing the import ldap statement. am I missing something here? Any ideas to resolve it?
thon39\site-packages\ldap\__init__.py", line 34, in <module>
import _ldap
ImportError: DLL load failed while importing _ldap: The specified module could not be found.
Visit the unofficial Python binaries page:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap
Download the appropriate WHL package for your system.
For example, if you're using Python 3.8 on an x64 system, download python_ldap‑3.3.1‑cp38‑cp38‑win_amd64.whl
(hint: do NOT download the +sasl version unless you have the Cyrus SASL code running on your system...)
Start the VirtualEnv for your project, if you're using one (C:\Users\youruser\.virtualenv\YourVirtualEnv\Scripts\activate.bat) -- if you're not, skip this step.
Then run pip3 install C:\Path\To\python_ldap_x.x.x-cpXX-cpXX-winXX.whl and this should install the Python DLL (pyd) file for you.
I am running a CentOS 7.2 system, and I recently used pyenv to install Python 2.7.5. I am rather new to Linux, and I was under the impression that I should use pyenv to install Python so as not to interfere with the "system Python." Before installing pyenv, yum worked perfectly.
Now, however, when I try to use yum I get the following error:
There was a problem importing one of the python modules required to run yum. The error leading to the problem was: No module named yum. Please install a package which provides this module, or verify that the module is installed correctly.
I tried following the advice from the first reply of this post. When I type find / -type f -executable -name 'python2*', I get the following output:
~/.pyenv/shims/python2
~/.pyenv/shims/python2.7
~/.pyenv/shims/python2.7-config
~/.pyenv/shims/python2-config
~/.pyenv/shims/versions/2.7.5/bin/python2.7
~/.pyenv/shims/versions/2.7.5/bin/python2.7-config
~/.pyenv/shims/versions/2.7.5/envs/spyderenv/bin/python2.7
/usr/bin/python2.7
/usr/bin/python2.7 should clearly be the system Python, but when I run it and type 'import yum', I get ImportError: No module named yum. (And just to cover my bases, the first line of the 'yum' file is #!/usr/bin/python, and /usr/bin/python is a link to python2, and python2 is a link to python2.7)
It seems that somehow pyenv is screwing things up, but I can't figure out how. Thanks in advance for the help.
I have a django app that requires Python (3.4) lxml package. I had a fair amount of trouble building the c shared libraries libxslt and libxml2 that lxml depends on in my red hat server environment. However, pip install lxml now completes successfully and I can import and use lxml in the command line interpreter.
When I restart apache, importing lxml within my django app causes the error:
ImportError: /usr/local/lib/python3.4/site-packages/lxml/etree.cpython-34m.so: undefined symbol: exsltMathXpathCtxtRegister
I have checked that my LD_LIBRARY_PATH is set the same in both environments (/usr/lib).
I notice that when I reinstall lxml through pip, pip tells me that it is building against libxml2/libxslt found at /usr/lib64. I have removed all libxml2.so and libxslt.so files found at /usr/lib64/ and been confounded to find that pip continues to tell me that it is building against lib64, that the install completes successfully, and that lxml still works correctly at command line but not through apache.
pip also says that the detected version of libxslt that it's using in the install is 1.1.23. However, I've used strace to see that when I import using the interpreter, the library that is loaded is /usr/lib/libxslt.so.1.1.28. I don't know of any tool or technique to find out what library is being loaded through apache..
Does anyone have any theories as to what is going on or how to debug the issue? Thanks in advance!
Fixed by removing libexslt.so files from usr/lib64/.
I trying to explore Menpo and Menpofit with PyCharm IDE. I have installed required packages but I have some issue:
from .fastpwa import CLookupPWA;
ImportError: cannot import name 'CLookupPWA'
from .normals import compute_normals;
ImportError: No module named 'menpo.shape.mesh.normals'
So how I can run Menpo and Menpofit with PyCharm?
How did you install the required packages? With the conda instructions, or via pip?
The error you are seeing there is because CLookupPWA and compute_normals are compiled Python extensions that need to be built before the package can be loaded. The easiest way to do this is to use the make command in the Menpo top level, which runs python setup.py build_ext --inplace.
If you are on Windows, things start to get pretty tricky, because you need to be able to compile the code properly. Take a look at the instructions here which try to explain how to properly set up Visual Studio 2008.