Import Error when trying to use TensorFlow - python-2.7

I am fairly new to TensorFlow and just installed it with CPU-support-only version following to this: https://www.tensorflow.org/install/install_linux
My Ubuntu is 16.04 and python installed is 2.7.13. I chose "native" pip installation.
The download and install process went though smoothly, however, when I tried to import Tensorflow and use it, it returns following error;
ImportError: /usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: undefined symbol: PyUnicodeUCS4_FromString
I have got no clue how to solve it after crawling in google.
If you know some idea on how to solve this and could give me some advice, much appreciated.
Thank you so much in advance!

It's because your python is built with UCS2, which is incompatible with the one assumed by tensorflow (UCS4). So either you build your python with UCS4 (--enable-unicode=ucs4) or build tensorflow from source may solve this issue, I guess.

Related

Could NOT find pocketsphinx (missing: pocketsphinx_DIR)

I am trying to setup gaitech_edu ROS package in order to build a turtlebot line follower. But, when I am trying to compile the package using catkin_make, I am getting following error:
I installed pocketsphinx library for python 2.7 using
pip install pocketsphinx.
But, even after that I am getting the same error. I am using ros melodic and python version is 2. Your help/advice will be highly appreciated. Thank you in advance.
I am able to solve this problem using this ros package for pocketsphinx.

Installing Tensorflow for Python 2.7 for Keras and CoreML conversion on Windows 10

I am currently working on an artificial neural network model with Keras for image recognition and I want to convert it using CoreML.
Unfortunately, I have been working with Python3 and CoreML only works with Python 2.7 at the moment. Moreover, Tensorflow for Python 2.7 does not seem to be supported by Windows... So my only hope is to find a way to install it.
I saw some tips using Docker Toolbox but I did not catch it and I failed when trying this solution, even though it looks like the only thing that works.
So, is there any quite simple way to install Tensorflow for Python 2.7 on Windows 10?
Thank you very much!
A non-optimal solution (the only one I found) in my opinion, is to install a Linux virtual machine. I used VitualBox for it.
Then, it is very easy to download Anaconda and Python 2, as well as the right versions of the packages. For example, you can download Tensorflow 1.1.0 using the following command $ pip install -I tensorflow==1.1.0.

Installing cPickle fails

I am working on ubuntu 14.04. Python version: 2.7.6.
I am trying to install cPickle, but I am getting error:
"could not find any downloads that satisfy the requirement cPickle"
I tried via, pip and apt-get as well. What might be reason, has this package been removed completely?
Actually, I tried importing cPickle and it worked. But I don't know why the error "could not find any downloads that satisfy the requirement cPickle". I will appreciate if someone can provide reason.
Also as commented by mike cleared my doubt.
"cPickle is installed when python itself is installed -- it's part of the standard library. So, just import cPickle and it should be there"

Where to put lapack/blas binaries in Anaconda install?

Scipy is installed with Anaconda, but won't work since no lapack and blas resources can be found. I've put the precompiled lapack/blas stuff from this link:
http://www.fi.muni.cz/~xsvobod2/misc/lapack/
into my Anaconda folder (user/anaconda) and also into my standard python istallation (c://python27). It still won't work.
I've checked out other questions on this forum on how to install. I've followed the instructions given here:
http://www.scipy.org/scipylib/building/windows.html
but Cmake always sais that the compiler can't compile a simple test program.
Problem solved! I uninstalled Python 2.7 and Anaconda, and now for some reason it works. Thanks to you guys who answered this post :)
Did you try this code?
-conda install -c pymc pymc
It includes installing Scipy.
"Lapack/blas resources not found" error disappeared when I tried this.

Error "from scipy.linalg import _fblas importerror: DLL load failed"

I found a code on internet which implement a paper "Effective 3D Action
Recognition Using EigenJoints" code. They implement in Python so I tried to install Python 2.7.9 and numpy, scipy, scikit-learn. All these libraries installed successfully. In the cmd when i tried to run python eigen.py it gives me this error.
Please anyone download this code and run it by yourself or help me to solve this error.
You have to do 2 steps:
download anaconda according to your system and specifications.
Make sure that Anaconda is installed on python version installed on your system. For example, if you have python 3.4, and anaconda in installled on 2.7, then you should remove python 3.4.
Afterwards, the code will run smoothly and all libraries will be well defined. I have made the same ;) Please, let me know if you face new problems.