importerror

can't fix ImportError: No module named request error

核能气质少年 提交于 2020-07-09 12:36:08
问题 hi i'm trying to learn web scraping but this code gives me an error i looked it up why and tried what they said but still doesn't work. i have a windows in my mac too and i tried in there and it worked but in macOS it doesn't work. ok this is the code i'm trying to execute: #!/usr/bin/env python3 import bs4 as bs import urllib.request sauce = urllib.request.urlopen("https://pythonprogramming.net/parsememcparseface/").read() soup = bs.BeautifulSoup(sauce, "lxml") print(soup) this is the error

ImportError: No module named flask_mail

余生长醉 提交于 2020-07-08 00:43:52
问题 from flask_mail import Mail,Message from flask import Flask I am trying to mail but import error is occurring 回答1: The are two packages by that name: The project found on GitHub and in PyPI uses flask_mail as the package name; see their documentation and project source code. Their layout indeed requires: from flask_mail import Mail, Message This is a fork of the other project, but is currently actively maintained. There is a project on Bitbucket, and their Flask-Mail documentation and the

Cannot import keras.initializers

纵饮孤独 提交于 2020-06-18 11:58:05
问题 I have imported all necessary modules from keras into jupyter notebook from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.models import Sequential from keras.layers import Embedding, Dense, Dropout, Reshape, Merge, BatchNormalization, TimeDistributed, Lambda, Activation, LSTM, Flatten, Convolution1D, GRU, MaxPooling1D from keras.regularizers import l2 from keras.callbacks import Callback, ModelCheckpoint, EarlyStopping from keras

importing module with same name as file [duplicate]

梦想与她 提交于 2020-06-12 05:03:54
问题 This question already has answers here : Importing from builtin library when module with same name exists (6 answers) Closed 4 years ago . I want to import logging https://docs.python.org/3/library/logging.html into a document named logging.py . When I try to import logging.handlers though, it fails because I believe it's searching the document for a handlers function, instead of importing from the module. How can I fix this so it will look for the higher level logging instead of looking

ModuleNotFoundError: No module named 'django' problem in vs code

假装没事ソ 提交于 2020-06-09 05:24:41
问题 I have installed virtual environment via pip install pipenv for my django project in vs code. Although I had successfully installed virtual environment and django(3.0.5) , but when I tried to python manage.py runserver then it throw me an error. It simply says that it was unable to find any module called django(but when I typed django-admin --version it shows that I had django installed and it's version is 3.0.5). In my cmd i got the following message: C:\Users\Ahnaaf Al Rafee\POLLSTAR

How to import modules from a file in a deeper directory?

孤街醉人 提交于 2020-05-23 21:30:08
问题 let's say my project's structure looks like: project ├── important.py └── files └── file1.py and the file important.py contains the class Important. How can I import the class(Important) from file1, while file1 is the python file which being executed? . The only solution I found was to add this code, but I wonder if there is a cleaner way: import sys; sys.path.append("..") from important import Important Things I have tried without success: from project.important import Important #

Import error in iPython after installing umfpack

时光毁灭记忆、已成空白 提交于 2020-05-18 05:39:17
问题 After installing the umfpack package (which I needed) I can no longer import any packages in an iPython Notebook. Any import command e.g import numpy as np results in a stream of errors the last of which is /Users/murray/anaconda/lib/python2.7/site-packages/numpy/core/__init__.py in <module>() 12 os.environ[envkey] = '1' 13 env_added.append(envkey) ---> 14 from . import multiarray 15 for envkey in env_added: 16 del os.environ[envkey] ImportError: dlopen(/Users/murray/anaconda/lib/python2.7

Import error in iPython after installing umfpack

老子叫甜甜 提交于 2020-05-18 05:39:11
问题 After installing the umfpack package (which I needed) I can no longer import any packages in an iPython Notebook. Any import command e.g import numpy as np results in a stream of errors the last of which is /Users/murray/anaconda/lib/python2.7/site-packages/numpy/core/__init__.py in <module>() 12 os.environ[envkey] = '1' 13 env_added.append(envkey) ---> 14 from . import multiarray 15 for envkey in env_added: 16 del os.environ[envkey] ImportError: dlopen(/Users/murray/anaconda/lib/python2.7

Import error in iPython after installing umfpack

六月ゝ 毕业季﹏ 提交于 2020-05-18 05:38:15
问题 After installing the umfpack package (which I needed) I can no longer import any packages in an iPython Notebook. Any import command e.g import numpy as np results in a stream of errors the last of which is /Users/murray/anaconda/lib/python2.7/site-packages/numpy/core/__init__.py in <module>() 12 os.environ[envkey] = '1' 13 env_added.append(envkey) ---> 14 from . import multiarray 15 for envkey in env_added: 16 del os.environ[envkey] ImportError: dlopen(/Users/murray/anaconda/lib/python2.7

No module named 'Kivy' even though I installed it

帅比萌擦擦* 提交于 2020-05-18 03:48:33
问题 I've installed Kivy and all the need files as far as I know, but I'm still getting this error message and I don't know why. from kivy.app import App from kivy.uix.gridlayout import GridLayout class Container(GridLayout): pass class MainApp(App): def build(self): self.title = 'Awesome app!!!' return Container() if __name__ == "__main__": app = MainApp() app.run() This is the error message I get: Traceback (most recent call last): File "C:\Users\Yassi\OneDrive\Afbeeldingen\Bureaublad\main.py",