Pycharm not finding module installed (dnspython) in venv [duplicate] - python

I want to check MX-Record from Python. So I installed the dnspython package, but when I try to import following library:
import dns.resolver
It shows the following error:
ModuleNotFoundError: No module named 'dns'.
I use PyCharm and Python 3.

You should install https://github.com/rthalley/dnspython first
pip install dnspython

Related

No module named 'bcolors' although 'Requirement already satisfied'

I am trying to use bcolors in my python code in Spyder/Anaconda but it keeps telling me
ModuleNotFoundError: No module named 'bcolors'.
So I installed it with pip install bcolorswhich gave me Requirement already satisfied: bcolors in e:\anaconda3\lib\site-packages (1.0.4), but it still doesn't work.
What am I doing wrong?
You had that error because you are in different interpreter trying to import the module. You should append the path of the module to your working directory.
import sys
sys.path.append("\anaconda3\lib\site-packages")
import bcolors
Try to install lower version of this module
pip install bcolors==1.0.2
Have you tried installing the pandas' library using pip install pandas
I was having trouble with the latest distribution as well. Installing 1.0.2 worked for me.

Why do I get 'No module named 'currency-symbols' when importing xls2xlsx, even though 'pip install currency-symbols' returns requirement satisfied?

My IDE is Spyder and the distribution I am using is miniconda. I use pip install in the anaconda prompt window (as I usually do).
'pip install xls2xlsx' seems to run fine and install the package.
When I try 'from xls2xlsx import XLS2XLSX' I get the following error:
ModuleNotFoundError: No module named 'currency-symbols'
If I try 'pip install currency-symbols' , I get:
'Requirement already satisfied: currency-symbols in c:\users\user\miniconda3\lib\site-packages (2.0.2) '
I can see both directories in the site-packages directory.
So I had the same or very similar problem, my trace-back said it could not import currency_symbols. I found that the module it was trying to import was the constants from that package. So I went into the py file where xls2xlsx had the issue
"htmlxls2xlsx.py" my traceback said line 40..
currency_symbols_constants =
importlib.import_module('currency-symbols.constants')
I noticed this was part of an 'exception' so I fixed line 37 from import currency_symbols.constants as currency_symbols_constants to import currency_symbols._constants as currency_symbols_constants
Now it imports just fine.
I also had version 2.0.2 of currency-symbols installed, but my working host was using 2.0.1. I discovered that if you install 2.0.1, the issue did not occur.
pip3 install -Iv currency-symbols==2.0.1

not able to import local python library

I created a python module and installed it.
pip3 install amnilogger.0.1.3.tar.gz
I confirmed it got installed by using pip3 list
pip3 list
- output:
Amnilogger 0.1.3
but when I'm trying to import it, it says module not found
import Amnilogger # no module

Python wkhtmltopdf can't import module

I am using Python version 3.6, Django version 1.9 and wkhtmltopdf version 0.2. My Python is not GCC it's Anaconda3.
When running my project which uses wkhtmltopdf, following error will be thrown:
from main import WKhtmlToPdf, wkhtmltopd
ModuleNotFoundError: No module named 'main'
This is how I imported the wkhtmltopdf:
import pdfkit
from wkhtmltopdf.views import PDFTemplateView
Yes i got the answer. This error occurred because i didn't installed django-wkhtmltopdf.
installed >> `pip install django-wkhtmltopdf
I hope this answer will help to resolve the similar error.
after installing pdfkit with following command and pointing python version 3.8, i was able to get pdfkit working on mac
pip3 install pdfkit

How to use DNS resolver in Python 3?

I want to check MX-Record from Python. So I installed the dnspython package, but when I try to import following library:
import dns.resolver
It shows the following error:
ModuleNotFoundError: No module named 'dns'.
I use PyCharm and Python 3.
You should install https://github.com/rthalley/dnspython first
pip install dnspython

Categories

Resources