Spyder (Python 3.6) wkhtmltopdf ModuleNotFoundError: No module named 'main' - python

I'm a relatively inexperienced programmer and I ran these import statements last week on my computer without a problem but now this week when I run the following statements in particular the wkhtmltopdf import I run into an error.
import pyodbc
import pymysql
import numpy as np
import pandas as pd
import datetime
import jinja2
import wkhtmltopdf
from wkhtmltopdf.main import WKhtmlToPdf
import datetime
import calendar
from pathlib import Path
This leads to this error
enter image description here
Any help is appreciated

Related

Cannot import name 'set_array_function_like_doc' from 'numpy.core.overrides'

I'm unable to import packages into anaconda Jupyter notebook.
import numpy
ImportError: cannot import name 'set_array_function_like_doc' from 'numpy.core.overrides' (C:\Users\4523220\AppData\Roaming\Python\Python38\site-packages\numpy\core\overrides.py)
import pandas as pd
ImportError: cannot import name 'set_array_function_like_doc' from 'numpy.core.overrides' (C:\Users\4523220\AppData\Roaming\Python\Python38\site-packages\numpy\core\overrides.py)
This is happening after restarting Anaconda.

Unable to import PyroModule

I am trying to import PyroModule using: from pyro.nn import PyroModule but, I am getting this error:
ImportError: cannot import name 'PyroModule' from 'pyro.nn' (/home/karima/anaconda3/envs/my_env/lib/python3.7/site-packages/pyro/nn/init.py)
Here is the whole piece of code:
import os
from functools import partial
import torch
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import pyro
import pyro.distributions as dist
from torch import nn
import seaborn as sns
from pyro.nn import PyroModule
I think the issue is due to wrong installation of pyro module,
instead of this
pip install pyronn
can you try this
pip install pyro-ppl
Let me know how this goes
I was facing the same problem with my MAC. None of the suggestions worked for me. I resolved it by running python -m pip install pyro-ppl
I hope this helps.

Visual Code Studio Pylint: Unable to import 'pyttsx3

Im running python and visual studio code on Mac when I try to import these packages:
import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
import pyjokes
import pywhatkit
import pyowm
It give me this:
Unable to import 'speech_recognition'
Unable to import 'wikipedia'
Unable to import 'pyjokes'
Unable to import 'pywhatkit'
Unable to import 'pyowm'
It says the same thing for all the packages, How do I fix This?

Databricks Error : ModuleNotFoundError: No module named 'sqlalchemy'

I am completely new to this Databricks.
In Databricks i have tried running the following packages in its python notebook
# Library Section
import psycopg2
import pandas as pd
import numpy as np
import sqlalchemy
from sqlalchemy import create_engine
from io import StringIO
import os
import smtplib
import time
from email.mime.text import MIMEText
import datetime
All these packages are running fine when i am running the cell individually. But when i am trying to run the packages on the auto schedule mode, its giving the error
ModuleNotFoundError: No module named 'sqlalchemy'
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<command-4076398358532638> in <module>
8 import pandas as pd
9 import numpy as np
---> 10 import sqlalchemy
11 from sqlalchemy import create_engine
12 from io import StringIO
ModuleNotFoundError: No module named 'sqlalchemy'
Absolutely no idea what is this problem all about. Can someone please help me with this.
Edit 1: i installed the following libraries in Databricks
psycopg2
sqlalchemy
flask_SQLAlchemy
but still the same problem
When you say I had installed the following libraries in Databricks, How exactly have you installed sqlalchemy library?
By default, Databricks clusters will not have sqlalchemy library installed on the runtime selected.
You need to install the sqlalchemy library explicitly and run the above command.
pip install SQLAlchemy

ModuleNotFoundError: No module named 'ebooklib'

Hi I'm using ebooklib in python and I'm getting this error
ModuleNotFoundError: No module named 'ebooklib'
I have successfully installed this library and it appears in my pip3 packages list.
I'm importing this in my python file like this
import os
import logging
import sys
import json
import traceback
from ast import literal_eval
from htmlparse import MyHTMLParser
from ebooklib import epub
I don't know what's wrong.
I had the same issue & fixed it by adding:
> export PYTHONPATH="/usr/local/lib/python3.8/site-packages:$PYTHONPATH"
to my .bash_profile file.
To see where your ebooklib is installed to
print(ebooklib.__file__)

Categories

Resources