I'm trying to build a rubik's cube solver and I'm using kociemba module. I had some problems with installation so I downloaded it manually from GitHub - https://github.com/muodov/kociemba. Now I'm testing it but I'm getting an error that I don't understand. Answer if you can help, thanks!
This is the test code:
import kociemba
kociemba.solve('DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD')
And I'm getting this output:
No module named 'kociemba.ckociembawrapper'
C:\Users\Paweł\AppData\Local\Programs\Python\Python39\lib\site-
packages\kociemba\__init__.py:21: SlowContextWarning: Native version of the package
is not available. We have to fallback to pure-Python implementation of the
algorithm, which is usually many times slower. If performance is important to you,
check official project page for a native implementation:
https://github.com/muodov/kociemba
warnings.warn("Native version of the package is not available. "
Related
I'm working on a project that requires C++ to call a program written in Python that relies on Python exclusive modules.
The project is handled using Qt Creator, and Python 3.7.5 and its packages are installed via Miniconda. I've gotten a basic embedding working using Pybind11 where basic interfacing works, however, most external modules cannot be imported.
For example, when importing Numpy through Pybind11, the following error is thrown (reduced for brevity):
Importing the numpy c-extensions failed.
Original error was: /home/brentnallt/miniconda3/envs/car_class_nogpu/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyMemoryView_FromObject
A similar error occurs when importing tensorflow through Pybind11:
ImportError: /home/brentnallt/miniconda3/envs/car_class_nogpu/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyUnicode_FromFormat
It appears to be a problem with Python's C API being found when reading C extension shared libraries. However, modules like lxml which use C source files import just fine. Additionally, I can import problem modules in projects separate from the project I'm working on, implying it's a setup problem. Note that this test project setup doesn't actually use any QT functionality, whereas the main one does.
My PYTHONHOME environment variable looks like:
['/home/brentnallt/miniconda3/envs/car_class_nogpu/lib/python3.7', '/home/brentnallt/miniconda3/envs/car_class_nogpu/lib/python3.7/site-packages', '/home/brentnallt/miniconda3/envs/car_class_nogpu/lib/python37.zip', '/home/brentnallt/miniconda3/envs/car_class_nogpu/lib/python3.7/lib-dynload', '.']
Are there any special considerations I have to make when embedding with Qt Creator? Or is this likely a different problem from a setup error?
Maybe you can consider using PythonQt as an alternative module for calling and importing python libraries from Qt application.
I've used it a lot in my projects and it never failed, but never used it with any kinda data scientific modules maybe you could give it a chance
https://mevislab.github.io/pythonqt/
I am a programming novice, so apologize in advance if I'm asking a dumb question or perpetrating some site etiquette violation. I have tried very hard to research the answer to my question on an issue that seems to be very common, but none of the proposed solutions have worked, so am looking for some help as I just don't know what to try next.
I'm trying to import Panda from iPython onto Windows 8. I have version 2.7 of Python and have successfully downloaded Numpy. Given the suggestions on this site, I have downloaded all the file that I think Panda is dependent on (pytx, dateutil, setuptools), but it still didn't work: the error message includes:
Import Error Traceback (most recent call)
<ipython-input-2-d6ac987968b6> in <module>()
try
from.import hashtable, tslib, lib
except exception: # pragma: no cover
import datetime
- C: \Python27\lib\site-packages\pandas\__init__.py in <module>():
Import Error: No module named six
Out of desperation, I also deleted all previous version of pandas and loaded Aneconda, thinking from previous responses that might help capture all required modules including Pandas, but the same error keeps coming up.
Any help would be much appreciated, and don't worry about pointing out the obvious (since it's clearly not obvious to me.)
The easiest way to get modules up and running on Windows is to use Christoph Gohlke's Python Extension Packages for Windows repository. It includes installers for a ton of (mainly scientific-related) modules, including pandas, matplotlib, six, etc. Since many modules included compiled extensions, installing using pip doesn't always work if the package maintainer hasn't published a binary for your package of interest. Gohlke's packages include everything already pre-compiled, you just need to choose the version and bit-ness of Python, and download the .exe files.
I have a small python script that needs to do some simple stats on some lists of numbers - the sort of thing the statistics.py library seems suitable for.
From what I can make out of the info on python.org, it should be part of the standard library in python 3.4.1 (on Win 64 bit), but I'm struggling to access the functions.
import statistics just gives a 'no module named 'statistics' error
Looking through the python34\Lib directory doesn't seem to show a statistics folder, and creating one and saving the statistics.py file available from python.org doesn't seem to make any difference.
Googling for how to install python libraries gives lots of examples referencing setup.py files and command line sequences, but i don't see how they relate to the statistics.py file available.
I'm obviously missing something (probably obvious!) but being a newbie at this i can't work out what it is. Any pointers?
I had the same problem, and instead of:
import statistics
I wrote:
from Lib import statistics
Good Luck!
I am writing a python program in Google App Engine that calculates tf-idf using TfidfVectorizer in sklearn.
I have added sklearn library and have the import as:
from sklearn.feature_extraction.text import TfidfVectorizer
However it gives me no module named _check_build although it is in the library that I have imported.
Note: I have the same code in pure python and it works just fine so there is nothing wrong with the python syntax or imports; The problem starts with GAE.
Do you know any way to solve this issue?
You can't. sklearn has a lot of 'c' based dependencies and typically any module that is named with a leading _ is a binary module.
So that's why you are getting a no module named _check_build error.
I seriously doubt you will get it to run even if you fake some of the 'c' libs unless they have pure python analogues.
I have done this in the past where libs had 'c' based performance versions as well as pure python.
if you are not using any of GAE-specific tools, try deploying your app on Heroku.
It let's you deploy a whole virtual environment with all the installed libraries on it. Specifically, Scikit-learn works on Heroku just fine. Check this Github repo for example.
I'm trying to install and configure pyIpopt. Ipopt is already installed and the examples run fine.
From the shell, when I do import pyIpopt, I get the error:
ImportError: /***PATH***/libipopt.so.1: undefined symbol: MPI_Init
The FAQ section of the pyIpopt git project has this to offer for these kinds of errors:
Do a Google search to find the library file, and add
-lWhateverLibrary in the makefile of pyipopt.
I've googled and found this: http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Init.html.
I don't know how to get the library or add it to the makefile... Any assistance would be much appreciated!
Just had a similar problem on ubuntu.
Using libmumps-seq worked for me:
installed libmumps-seq-4.9.2 (just with apt-get, along side the ordinary libmumps)
in setup.py changed in the libraries list argument 'coinmumps' to 'dmumps_seq-4.9.2'
rebuilt and installed.
If I understand it correctly, the default mumps is distributed (using MPI lib which can be a world of pain), and all i needed is the sequential one, which mumps-seq provides.