ImportError: No module named pyreadability in conda env - python

in my python code I've got the line:
from pyreadability import pyreadability as pyrb
And I'm getting the error :
ImportError: No module named pyreadability
I'm in Ubuntu, using python 2.7 and running code inside a conda env named mzh27.
I already tried these commands but none of them made the error solve
pip install PyReadability
conda install -c anaconda lxml
/home/{usr}/anaconda2/envs/mzh27/bin/pip install PyReadability
pip install readability-lxml
/home/{usr}/anaconda2/envs/mzh27/bin/pip readability-lxml
In all of those cases, the module installed successfully but error was still there.
Any Idea what to do for it?

The problem was the repository I've cloned was missing the file named pyreadability.py. The package was not the one I thought. It was implemented by the repository owner (who forgot to add files to the repository) and just have similar names to python packages that are available to install.

Related

Weird error of ModuleNotFoundError: No module named 'tqdm' when run pip install -e but works when using python setup install

when I git clone this github repo, I am able to install it via python setup.py install. However, the installation fails if tries to use pip install -e . with an error:
ModuleNotFoundError: No module named 'tqdm'
I looked up this issue and ensured tqdm has been installed in the environment.
I also noticed that travis service for this package cannot also pass its build and having the same error regarding tqdm: https://travis-ci.com/github/aristoteleo/dynamo-release/jobs/367588183
see [screenshot of the error message][1]
I managed to fix this issue. The culprit is simply because you cannot specify specific version of tqdm in your setup.py file. Meanwhile, the specification of package requirement between the pyproject.toml and the setup.py need to match up.

Unable to Import Poppler even after installing in conda

I am trying to use pdf rendering package Poppler and I found an Anaconda Installation for the same here
https://anaconda.org/conda-forge/poppler
I can see the Poppler package installed in my conda env when I do
conda <env> list
However when I try to import the package in my code by doing
import poppler
I get :
ModuleNotFoundError: No module named 'poppler'
How do I find if this is the right name of the module if its not the name shown in then conda env list.. I believe the package name is the module name with its own classes and methods.
Why is it saying No module?

pip list shows installed module but still getting import error

I am working with python flask's requests module. I have installed requests module using :
pip install requests
And verified that requests module exists when I run :
pip list
But when I run my python application , I receive import Error for requests module.
I noticed that pip is installing the module in C:\Users\xx\Documents\Projects\Python\Python3REST\lib\site-packages\ folder BUT the interpreter is looking for the module in C:\Users\xx\Documents\Projects\Python\Python3REST\lib\site-packages\flask\ folder.
I have tried running the command :
pip install --install-option="Path to install in" requests
But threw some other error.
The import error I am getting states :
ImportError: cannot import name 'requests' from 'flask'
(C:\Users\xx\Documents\Projects\Python\Python3REST\lib\site-packages\flask\__init__.py)
I am working in virtualenv in Windows 10.
I recently had the same problem installing a self made package. I installed it with pip install <package> and checked it was actually installed with pip list but running the script with import <package> returned a ModuleNotFoundError: No module named <package>.
I solved the problem creating an empty file called __init__.py in the package directory.
Check https://pythontips.com/2013/07/28/what-is-init-py/ and https://docs.python.org/3/tutorial/modules.html#packages for better understanding.
what if you add that folder to your path? using sys.path.extend?
I solved it using python3 -m pip install <package name>. In the OP's case, it should be python3 -m pip install requests.
Note that I'm using python 3.10.

Virtualenv installed package not found

I installed a django-secure into a virtualenv using pip. The install was normal. The module shows up in the virtualenv pip list and in virtualenvs/dev/lib/python2.7/site-packages. I get the following error when running my code.
ImportError: No module named djangosecure
The folder is in there and there is an init. No install issues. What am I doing wrong and how do I fix it?
Make sure your wsgi file points to the right virtualenv!

ImportError: No Module named picklefield.fields (Yep pip install says it is there)

I am using vagrant to run my python environment. In my data models I am using django-picklefield module.
when I run my server it says
ImportError: No module named picklefield.fields.
I tried to uninstall and install the picklefield module. Still having the same problem.
You should be able install via:
/[your python install directory]/bin/pip install django-picklefield
If you do this directly instead of a general pip call to install django-picklefield, that will ensure that it is installed on the correct version of Python.
Based on your description my best guess is that you have multiple versions of Python installed, and that your install/uninstall is happening on the wrong one.

Categories

Resources