ModuleNotFoundError: No module named 'keras_contrib' - python

I installed keras_contrib using:
pip install git+https://www.github.com/keras-team/keras-contrib.git
Now when I run:
from keras_contrib.layers import CRF
It gives the following error:
ModuleNotFoundError: No module named 'keras_contrib'
How can I find out what is this package's path in my computer so that I add it to my python path?

First you must install particular versions of seqeval and keras
pip install seqeval==0.0.5
pip install keras==2.2.4
Then you must git clone the keras-contrib repo. Then cd to the keras-contrib folder and do
python setup.py install
Finally install a particular version of tensorflow
pip install tensorflow==1.14.0
See this stackoverflow post for more info

When running 'pip install ' in the command line, it usually print information while installing the module. On some OSs, you can find the download location there. Otherwise, you can use the following command line code to download towards a precise directory:
pip install path-to-downloaded-package

Related

Installing a repo not in PyPI

This is my first time trying to install a repo not in PyPI. I'm not sure if I'm having a general issue or a specific issue with the package.
Repo:
https://github.com/jeslago/epftoolbox
Instructions are:
git clone https://github.com/jeslago/epftoolbox.git
cd epftoolbox
Then, simply install the library using pip:
pip install .
I've tried several approaches.
I tried adding the repo in Pycharm, as "https://github.com/jeslago/epftoolbox.git/" in the settings.
I tried using pip install from a local version of the repo
python -m pip install C:\Users\user\epftoolbox\
I tried installing in anaconda
git clone https://github.com/jeslago/epftoolbox.git
cd epftoolbox
pip install .
I get this error
Successfully built epftoolbox termcolor
ERROR: tensorflow 2.3.0 has requirement scipy==1.4.1, but you'll have scipy 1.5.2 which is incompatible.
But it finishes with "Successfully installed epftoolbox-1.0"
The issue is that I can do "import epftoolbox"
Fine. But if I try and run a script with "from epftoolbox.data import read_data"
I get the error
ModuleNotFoundError: No module named 'epftoolbox.data'
So I take it that the package didn't actually install?
I'm not sure what to try next?
I've python 3.8.5 installed 64 bit.
I've get the same issue in pycharm and idle.
Probably you need to install specific version of scipy to work with this library, try to uninstall current version and then install the correct version with this commands:
python -m uninstall scipy
python -m install -Iv scipy==1.4.1

Getting Import error while importing face_recognition in PyCharm

I am new to PyCharm and trying some face recognition stuff. I need a face_recogniton library for my work which is installed using the following command (I'm using Ubuntu 18.04 as my OS):
pip install face_recognition
I am able to import it in python interpreter but it throws import error in PyCharm
ImportError: No module named 'face_recognition'.
Thanks for your effort in helping me.
For installing face-recognition module for Ubuntu 18.04: (Try for other OS, I used this for 18.04)
Install cmake: pip install cmake
After cmake is successfully installed
Optional: Install git if you don't have git
git clone https://github.com/davisking/dlib.git
build the main dlib library
cd dlib
mkdir build; cd build; cmake ..; cmake --build .
Build and install python essentials
cd ..
python3 setup.py install
After all this run these to verify
python3
>> import dlib
Now install face_recognition
pip3 install face_recognition
Takes some time but that is okay! I hope it worked for you
Refer these materials:
face-recognition original repo: https://github.com/ageitgey/face_recognition#installing-on-mac-or-linux
dlib: https://gist.github.com/ageitgey/629d75c1baac34dfa5ca2a1928a7aeaf
Reading face_recognition installation guide on github, make sure you have dlib installed and then install face_recognition with:
pip3 install face_recognition
Also, check if PyCharm is using environment where you installed face_recognition. Maybe PyCharm created it's own virtual env and you are using it without face_recognition.
For more info about how to install module in PyCharm env, please check this answer, just except pygame check if face_recognition is listed. If not, install it.
Looks like you have installed maybe multiple versions of Python. You seem to have installed face_recognition for python version 2, whereas you are trying to access the module from Python version 3. You should consider using virtual environments and set up Python Interpreter accordingly.
Follow https://www.jetbrains.com/help/idea/configuring-local-python-interpreters.html on how to configure the interpreter.
Download this file cmake-3.17.0-rc3-win64-x64.msi from cmake.org and install it (By default it will be installed in C:\Program Files\CMake\bin).
After the installation copy this path and edit environment variable -> path -> paste that path -> click ok. Open the cmd and now use pip install face_recognition
i hope it should work....

Not able to install skbuild

I am trying to install "CMake" with command
pip3 install CMake.
Its gives an error for a module "skbuild"
from skbuild import setup, ModuleNotFoundError: No module named 'skbuild'
But but when tried to install skbuild with command
pip3 install skbuild
it gives error
"Could not find a version that satisfies the requirement skbuild (from versions: ) No matching distribution found for skbuild".
I am not able to solve this error. Please help. I trying the implementation it on Window 10. Using Python 3.7.0. I tried couple of versions of pip3 (10.0.1, 9.0.3, 9.0.2, 9.0.1). Nothing is working.
Try pip install scikit-build. For me, pip install cmake works properly afterwards.
this worked for me while installation of this github repo https://github.com/ultralytics/yolov3
# For pip
pip install scikit-build
# For pip3
pip3 install scikit-build
There are pre-compiled binaries available on THIS page for Windows as MSI packages and ZIP files. You can find the one for the OS you are using.
If you want to proceed with your current approach then can you can probably refer THIS LINK

Python “pip install ” is failing with AttributeError: 'module' object has no attribute '_vendor'

I'm attempting to install a package from a local directory, on Windows Server 2008. The package doesn't really matter I guess, but for arguments sake its Luigi. I navigate to the directory and use the following command:
pip install setup.py
and the following error is returned:
'module' object has no attribute '_vendor'); 'pip' is a package and cannot be directly executed.
I've tried to reinstall pip, upgrade pip and install via easy_install and I'm just getting exactly the same error every time. anyone else had this same error and can recommend a solution?
I've tried;
python -m pip install --upgrade pip
easy_install -U pip
I've also tried uninstalling pip but I just get the same error.
To install a package from a local directory with pip, you'll use either
pip install .
or
pip install -e .
from the directory containing the package's setup.py.
Note the . at the end.
The -e version installs it the same way as python setup.py develop

Installing requests-kerberos on Windows

Is there any way to install requests-kerberos on Windows?
When I try to install it with pip I have the following error:
py -m pip install requests-kerberos
ImportError: No module named 'commands'
Command "python setup.py egg_info" failed with error code 1 in C:\Users\user1\AppData\Local\Temp\pip-build-n8s_inn\kerberos
I would be grateful if anyone knew another kerberos module. I'm using Python 3.4 and Windows 8.
Best regards.
The commands module was deprecated in python 2.6.
Thus, the issue appears to be a problem with your pip installation, and not with requests-kerberos.
There are a few things you can try, but I would focus on ensuring pip is working correctly. While you could install the package manually, you are really just pushing the pip problem down the road until the next time you install a package.
Ensure pip is installed correctly.
Use the pip command to ensure you are running pip in the python 3.4 context: (Note, this is my output, yours will be different because you are on Windows and running 3.4)
$ pip --version
pip 1.5.6 from /Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg (python 2.7)
Additional information about pip can be found here.
Download and install manually
Download the package manually from the pypi repo.
Download the .tar.gz
Extract the tar.gz and run python setup.py install

Categories

Resources