Install utils package in python facing with error Package not found - python

I tried to install utils Python package using Anaconda but I ended up with this error:
Package missing in current win-64 channels
I tried:
conda install -c bioconda utils, but still the same. Can anyone help me fix it?

to install run:
pip install python-utils
to import:
import python_utils
worked fine on jupyter notebook ubuntu 16.04

Install:
pip install utils
Import:
import utils

Try run:
conda install --channel bioconda/label/bioconda-utils-test package
or
conda install -c conda-forge python-utils

I succeed using following instructions:
The package can be installed through pip (this is the recommended method):
pip install python-utils
Or if pip is not available, easy_install should work as well:
easy_install python-utils
for more details please refer to https://pypi.org/project/python-utils/
however, I failed using Влад Давидченко's answers.

Once you have installed python-utils with:
conda install --name myenv python-utils
You can then reference the package by using:
from python_utils import *

Related

ImportError: DLL load failed while importing pdftotext: The specified module could not be found

I installed installed pdftotext module as
conda install -c conda-forge poppler
pip install pdftotext (I also tried pip install pdftotext==2.1.5), but it still triggers an error when I try to import it, abeit being installed successfully:
import pdftotext
ERROR:
ImportError: DLL load failed while importing pdftotext: The specified module could not be found.
IDK what else to do; so, your help will be really appreciated:)
I ran into the same problem and noticed that pdftotext wasn't listed in conda list. As it turned out, simply running pip install pdftotext inside a new environment installs pdftotext as a system-wide package, but not as a specific package for your current conda enviroment.
I fixed this problem by installing pip into my conda environment using the following command:
conda install pip
After that, I ran pip install pdftotext==2.1.4 (as the 2.1.5 version didn't work for me).
Lastly, I checked conda list to verify the installation.
Personally I have had the same question. I have solved it by
conda update conda .
Then I redo the same procedure
conda install -c conda-forge poppler
pip install pdftotext
After this 3 steps I import successfully pdftotext. I hope it also works for you.

Python pandas modin - no module found

I am using anaconda and just tried:
pip install modin
that finished without issue.
Then created very simple python script and in it only have one line:
import modin.pandas as pd
Error that I am getting:
ModuleNotFoundError: No module named 'modin.pandas'; 'modin' is not a package
If I use regular panda package - all works fine.
In addition tried:
pip install --upgrade pip
pip install pandas==0.23.4 --force-reinstall
pip install modin --force-reinstall
pip install ray --force-reinstall
But that did not help (same error).
What should be done?
You should use:
pip install modin[ray] as python suggests
Try work in an environment:
conda create --name modin python=3.6 pandas modin --channel conda-forge
So we created environment called modin with Python 3.6. pandas and mod in from conda-forge channel. Let conda deal with extra-requirements. Activate the environment and install other packages.
Note ray is yet to be support in Windows. Windows usera use WSL
conda activate modin
conda install ray -c bioconda
Test if everything is okay:
python -c "import modin.pandas as pd"
If no error! You are good to go!
If you are using Anaconda environment then you should firstly install modin through following command:
conda install -c conda-forge modin
Then import
import modin.padas as pd
This pip install 'modin[dask]'works for me.
I am using Python 3.9.
what is your script name? I had same issue when I named my script as modin.py. After I renamed it to something else, the issue was gone.

ModuleNotFoundError: No module named 'imblearn'

I tried running the following code:
from imblearn import under_sampling, over_sampling
from imblearn.over_sampling import SMOTE
sm = SMOTE(random_state=12, ratio = 1.0)
x_SMOTE, y_SMOTE = sm.fit_sample(X, y)
which gives me the error message:
ModuleNotFoundError: No module named 'imblearn'
I have tried installing the imblearn module in multiple ways, they all seem to work (there are no errors given during the installation but when I run the above code, I get an error message).
I tried istalling imblearn using the following suggested in other stackoverflow questions:
pip install -U imbalanced-learn
pip install imblearn
!pip install imblearn
pip install -c glemaitre imbalanced-learn
pip install imblearn==0.0
None of these seem to help... Any ideas? Thank you!
I installed the module named imblearn using anaconda command prompt.
conda install -c conda-forge imbalanced-learn
Then imported the packages
from imblearn import under_sampling, over_sampling
from imblearn.over_sampling import SMOTE
Again, I tried to install imblearn through pip, it works for me.
(base) C:\WINDOWS\system32>pip install -U imbalanced-learn
Requirement already up-to-date: imbalanced-learn in c:\users\ashok\anaconda3\lib\site-packages (0.4.3)
Requirement already satisfied, skipping upgrade: numpy>=1.8.2 in c:\users\ashok\anaconda3\lib\site-packages (from imbalanced-learn) (1.15.3)
Requirement already satisfied, skipping upgrade: scipy>=0.13.3 in c:\users\ashok\anaconda3\lib\site-packages (from imbalanced-learn) (0.19.1)
Requirement already satisfied, skipping upgrade: scikit-learn>=0.20 in c:\users\ashok\anaconda3\lib\site-packages (from imbalanced-learn) (0.20.0)
On AWS SageMaker, follow the documentation:
!pip install imbalanced-learn
in a notebook cell.
This worked for me
First install the package in your environment:
pip install -U imbalanced-learn
Next:
conda install -c conda-forge imbalanced-learn
Open anaconda prompt and install below module:
conda install -c conda-forge imbalanced-learn
conda install -c conda-forge/label/gcc7 imbalanced-learn
conda install -c conda-forge/label/cf201901 imbalanced-learn
Those who have permission issue or failed to install it can follow this.
conda create --name dsc_new
conda activate dsc_new
conda install -c conda-forge imbalanced-learn
try on your notebook pip install imbalanced-learn --user
I have been fixed it by applying the following inside a Jupyter Notebook.
!pip install imbalanced-learn==0.6.0
!pip install scikit-learn==0.22.1
I had the same issue which was rectified by using:
!pip install -U imbalanced-learn
Then this:
conda install -c conda-forge imbalanced-learn
Updated my conda:
conda update -n base -c conda-forge conda
Restarted the kernel.
try this way:
from imblearn import under_sampling
from imblearn import over_sampling
from imblearn.over_sampling import SMOTE
OR
import imblearn *
I've come across the same problem a few days ago - trying to use imblearn inside a Jupyter Notebook. This question led me to the solution:
conda install -c glemaitre imbalanced-learn
Notice, one of the commands you tried (pip install -c glemaitre imbalanced-learn) doesn't make sense: -c glemaitre is an argument for Anaconda python distributions, which tells conda (Anaconda's CLI) to download the module from a source different than the defaults (glemaitre's channel). Since that argument is conda-specific, it doen't apply to pip commands.
Using python=3.6.10 and below worked for me.
I was dealing with the same problem. Updating packages, upgrading pip or python version did not resolve the problem for me.
The issue was that pip installed package to one folder, but my jupyter notebook imported packages from another folder. To get the path from where your packages are imported, you may use:
import site
site.getsitepackages()
# /your/path/from/python
Then you may check in terminal where pip installs your packages :
pip show imblearn
If the paths do not coincide, you may manually set the path for pip in terminal:
pip config set global.target /your/path/from/python
And install your package again by
pip install imblearn
If you are still experiencing error after installing imblearn either on Anaconda terminal while using Vscode. Try to restart Vscode for it to reflect.

python: install dash with conda

How can I install dash step-by-step?
I'm really new at importing packages in python. I have python 3.6.4 on my computer and I'm trying to install the dash package, dash_core_components.
I tried to type in the anaconda prompt: conda install dash (not available for current channels)
I also tried to install pip through conda: conda install pip then pip install dash ... but got an error also.
I'm really new and honestly don't really know what I'm doing. I got a pop-up from spyder when I open it saying to never use pip, it can break stuff. I don't understand why.
Here are the commands to get conda to install dash:
conda install -c conda-forge dash-renderer
conda install -c conda-forge dash
conda install -c conda-forge dash-html-components
conda install -c conda-forge dash-core-components
conda install -c conda-forge plotly
If you go to the Anaconda site and search for the package they will give you the conda command to install the package.
Along with the others. You can also try the following:
import pip
pip.main(['install', 'dash-renderer', '--user'])
pip.main(['install', 'dash', '--user'])
pip.main(['install', 'dash-html-components', '--user'])
pip.main(['install', 'dash-core-components', '--user'])
pip.main(['install', 'plotly', '--user'])
Note: This will install the packages only for the current session.
or
Try the following too:
!pip install dash-renderer
!pip install dash
!pip install dash-html-components
!pip install dash-core-components
!pip install plotly
Per most recent update from Dash website, the below should now be sufficient:
pip install dash==1.8.0
Note: starting with dash 0.37.0, dash automatically installs
dash-renderer, dash-core-components, dash-html-components, and
dash-table, using known-compatible versions of each. You need not and
should not install these separately any longer, only dash itself.
Per Lucas's comment above, with Anaconda distribution use :
conda install -c conda-forge dash
Try one of the following:
conda install -c conda-forge dash
conda install -c conda-forge/label/broken dash
It worked for me for a different package (opencv). Source at this link from anaconda.org

Importing caffe results in ImportError: "No module named google.protobuf.internal" (import enum_type_wrapper)

I installed Anaconda Python on my machine. When I start the Python Interpreter and type "import caffe" in the Python shell, I get the following error:
ImportError: No module named google.protobuf.internal
I have the following files:
wire_format_lite_inl.h
wire_format_lite.h
wire_format.h
unknown_field_set.h
text_format.h
service.h
repeated_field.h
reflection_ops.h
message_lite.h
message.h
generated_message_util.h
extension_set.h
descriptor.proto
descriptor.h
generated_message_reflection.h
generated_enum_reflection.h
dynamic_message.h
descriptor.pb.h
descriptor_database.h
What files do I need so the import will work? Is there an "internal.h" file that is required?
This is probably because you have two python environments in your machine, the one provided by your linux distribution(pip) and the other by the anaconda environment (/home/username/anaconda2/bin/pip).
Try installing protobuf for both environments to be sure
pip install protobuf
/home/username/anaconda2/bin/pip install protobuf
If you are using Anaconda, do conda install protobuf
If you are using Ubuntu, try installing protobuf using
sudo apt-get install protobuf
It solved the same problem that I faced.
Easiest way to fix it:
pip install grpcio
pip install protobuf
When have multiple python version use: as suggested by aimuch.
/usr/local/bin/pip2 install protobuf
/usr/local/bin/pip2 install grpcio
This is because the python envirnment confusion.
# check where pip2
$ where pip2
/usr/local/bin/pip2
/usr/bin/pip2
# check where pip
$ which pip
/usr/local/bin/pip
On my computer, I have two pip2(I install caffe using python2 env), so I used /usr/local/bin/pip2 install protobuf solved this problem.
/usr/local/bin/pip2 install protobuf

Categories