I am trying to implement tensorflows word2vec_basic.py model in my system.I went through this tutorial to understand and implement it.
After I ran the word2vec code using python3 in my system it asked me to install sklearn, matplotlib, and scipy to visualize embeddings.
So I installed sklearn, matplotlib, and scipy using pip in my system and ran the code a second time but it still asks me to install the above 3 again.
No errors were there during installation of sklearn, matplotlib, and scipy. I am using Ubuntu 16.04 LTS.
UPDATE: Here is the screenshot after removing try and except -
https://ibin.co/377XsooeSdej.png
As evident from the error message, you are missing the python3-tk package. Try to install it using,
sudo apt-get install python3-tk
Related
I'm trying to install Lazypredict, an autoML python library, on macOS 10.14.6.
Thus, I simply run
"pip install lazypredict" in the terminal , it wants to install lightgbm, but always fails to do so. I think it tries to install lightgbm through pip although I have already installed it with brew (as recommendend).
Hence i get such errors and really don't know what to do. I already have CMake installed too
Do you have ideas of what could enable me to install lazypredict ?
PS: Same happenned with other auto ML packages such as PyCaret
The errors I get are the following:
ERROR: Failed building wheel for lightgbm
Running setup.py clean for lightgbm
Failed to build lightgbm
Installing collected packages: lightgbm
Running setup.py install for lightgbm ... error
ERROR: Command errored out with exit status 1:
Exception: Please install CMake and all required dependencies first
SOLUTION 1 (Recommended)
LazyPredict works with specific versions of other libraries, I recommend you to work with Google Colab or Kaggle Notebook. They create a separate environment having multiple versions of other libraries, when you install lazypredict on colad or kaggle you won't face any issues.
One more reason to use lazypredict on Colab or Kaggle is that this library is just for testing purposes you cannot use this library for deployment, and it won't work on large datasets.
SOLUTION 2
As I mentioned lazypredict depends on specific versions of other libraries, you can search on google and will find a list of those libraries along with their version, try to manually install those versions but it is a time-consuming step, the other way is to install a new python version within which you can create a Virtual Environment and then try to install lazypredict in it.
SOLUTION 3 (only perform if you know docker)
If you are aware of Docker you can install a python image in it, a fresh install that does not contain any libraries, so you can install lazypredict in it.
Please see the following figure. I need to install xgboost for python using Anaconda.
However, I don't know which of the red-marked packages are relevant for me.
In my experience, when I installed the single package, i.e. py-xgboost-cpu, I was asked to (automatically) install rest of the other libraries, which I did.
I am trying to develop some time-series sequence prediction, using the latest resources available. To that end, I did check the example code from TensorFlow time-series, but I'm getting this error:
AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'
I'm using Anaconda. The current environment is Python 3.5 and TensorFlow 1.2.1. Also tried TensorFlow 1.3, but nothing changed.
Here is the code I'm trying to run. I did not find anything useful related to the issue on Google. Any ideas on how to solve it?
As Conan.Net wrote:
I tried to remove/clean some environments from anaconda and install
all again and it work this time.
This solution worked for me as well, so though not ideal, it will solve the problem. If you are using anaconda, it might happen when installing some packages and then removing them (e.g. tensorflow vs tensorflow-gpu) leaves some dependencies hanging. In my case, I used:
conda remove --name py2_tf_gpu --all
then
conda create --name py2_tf_gpu python=2 anaconda pandas numpy scipy jupyter
source activate py2_tf_gpu
pip install --ignore-installed --upgrade tensorflow-gpu
pip currently installs a later(1.4) than anaconda(1.3) version and I had need for it.
Maybe the version of tensorflow doesn't match the version of keras.
Using a lower version of keras solve this problem
I've been trying to install sklearn manually using pip with python 3.6 and i'm facing a lot of trouble. I couldn't get it installed cuz there was a problem with scipy.
I installed pycharm and tried to install both of them using the Packages interfaces and i'm still getting an error while trying to install sklearn.
NB: I installed scipy and numpy+mkl using their whl files
The module name is scikit-learn, not sklearn.
Sorry that I don't have enough reputation to post images.
The main problem is that it tells me that I need to install a C compiler and reinstall gensim or the train will be slow, and in fact it is really slow.
I have installed mingw32, Visual Studio 2008, and have added the mingw32 environment variable to my path.
Any ideas on how to solve it?
Just as you I installed mingw32 and added MinGW\bin to my PATH variable. I then uninstalled gensim with pip uninstall gensim and tried reinstalling with pip install gensim. That however gave the same warning so instead I downloaded gensim-0.12.3.tar.gz from here. I unzipped the archive and also the inner one, opened a cmd window in the folder and ran python setup.py install to install gensim. Now I could already from the output see that it could see the MinGW install. It installed correctly and I could run gensim without the warning and much faster.
Similar to user1151923, after adding MinGW\bin to my path variable and uninstalling\reinstalling gensim through pip, I still received the same warning message. I ran the following code to fix this problem (installed gensim from conda).
pip uninstall gensim
conda install gensim
I had the same problem and tried many solutions, but none of them worked except degrading to gensim version 3.7.1.
When I installed it from conda-forge then I obtained a version that is already compiled and fast:
conda install -c conda-forge gensim