importerror

Sphinx: how to exclude imports in automodule?

余生颓废 提交于 2019-12-28 06:00:13
问题 I have a Raspberry Pi project written in Python that uses RPi.GPIO module. All the work on the code is done on a Windows box where RPi.GPIO will not install and every time I try to run autodoc it crashes saying it cannot import RPi.GPIO. D:\cube\docs\ledcube.rst:4: WARNING: autodoc: failed to import module u'ledcube' ; the following exception was raised: Traceback (most recent call last): File "C:\Python27\lib\site-packages\sphinx-1.2b1-py2.7.egg\sphinx\ext\autodoc. py", line 326, in import

google-app-engine : Import works only after a refresh

依然范特西╮ 提交于 2019-12-25 18:13:15
问题 After somes problems with a simple import of httplib2 (see my post here), i meet a different problem with the import of gflags. In fact, on dev server, i have an ImportError the first time that I lanch the apps. But, if i refresh the browser, the apps works ! If i looking in logs, i can see : ... ImportError: No module named gflags [App Instance] [0] [dev_appserver.py:2891] INFO "GET / HTTP/1.1" 500 - [App Instance] [0] [py_zipimport.py:148] INFO zipimporter('/usr/lib/python2.5/site-packages

graph-tool crahes on import

女生的网名这么多〃 提交于 2019-12-25 16:24:18
问题 Using Python 2.7 I try to import graph-tool: from graph_tool.all import * Each time I execute the above command the following error is returned and Python crashes. dyld: lazy symbol binding failed: Symbol not found: __ZN5boost6python6detail11init_moduleEPKcPFvvE Referenced from: /usr/local/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so Expected in: flat namespace dyld: Symbol not found: __ZN5boost6python6detail11init_moduleEPKcPFvvE Referenced from: /usr/local/lib/python2.7/site

Python: Submodules Not Found

China☆狼群 提交于 2019-12-25 05:25:09
问题 My Python couldn't figure out the submodules when I was trying to import reportlab.graphics.shapes like this: >>> from reportlab.graphics.shapes import Drawing Traceback (most recent call last): File "<pyshell#14>", line 1, in <module> from reportlab.graphics.shapes import Drawing ImportError: No module named shapes I have copied the reportlab package to /site-packages and I can import module reportlab.graphics successfully. My Python version is 2.7.3. Could anyone help me to fix this problem

Livewires + Pygame Error

风流意气都作罢 提交于 2019-12-25 02:11:09
问题 So I am running Windows 8 with python 3.3 installed. I have livewires and pygame installed. But when I run the code: from livewires import games games.init(screen_width = 640, screen_height = 480, fps = 50) games.screen.mainloop() I get an error saying... ImportError: No module name 'pygame.image'. Does anyone know how to fix this? 回答1: Did you install pygame in the file directory of the python interpreter? But anyway pygame is not available for python 3.3 at the moment. If you want to use

How to solve the conda virtual env and system env conflict on import cv2?

本秂侑毒 提交于 2019-12-25 00:43:27
问题 I have installed opencv 3.4.1 correctly on my system enviroment. But after I create a conda virtual environment using a yml file inlcues opencv3.2.0, it leads some problems here: Under the conda virtual env, I have to always first cd PATH_TO_VIRTUAL_ENV/lib/python3.5/site_packages such that import cv2 is correctly using the 3.2.0 version of opencv,without this step, 3.4.1 will be used. Under the conda base environment , if the PATH in ~/.bashrc is added to anaconda3, then I will under conda

ImportError: No module named … in Colab google

时光总嘲笑我的痴心妄想 提交于 2019-12-24 21:58:37
问题 I'm following the tutorial here (Object Detection in Google Colab with Custom Dataset). The first line of the notebook is a git clone of the tensorflow models: !git clone --quiet https://github.com/tensorflow/models.git After, they set the PYTHONPATH variable to be sure we can import models. os.environ['PYTHONPATH'] += ':/content/models/research/:/content/models/research/slim/' If I try at this stage to import a model from nets import inception_resnet_v2 I get the error: ImportError: No

ImportError in Cython

吃可爱长大的小学妹 提交于 2019-12-24 19:18:23
问题 I'm fairly new to cython, so I have a basic question. I'm trying to import a base class from one cython file into another cython file to define a derived class. I have the following code in a single directory called cythonTest/ : afile.pxd afile.pyx bfile.pxd bfile.pyx __init__.py setup.py afile.pxd: cdef class A: pass afile.pyx: cdef class A: def __init__(self): print("A__init__()") bfile.pxd: from afile cimport A cdef class B(A): pass bfile.pyx: cdef class B(A): def __init__(self): print "B

Nltk import problems

流过昼夜 提交于 2019-12-24 19:15:22
问题 I can import ntlk and the pos_tag in the python shell just fine like so. >>> import nltk >>> from nltk import pos_tag But when I need to write a script like import nltk from nltk import pos_tag I get a traceback error Traceback (most recent call last): File "mynltkfile.py", line 1, in <module> from nltk import pos_tag File "/Users/jacksongeller/Desktop/nltktest/mynltkfile.py", line 1, in <module> from nltk import pos_tag ImportError: cannot import name pos_tag I have already done nltk

Flask-Migrate “ModuleNotFoundError”

僤鯓⒐⒋嵵緔 提交于 2019-12-24 18:31:20
问题 I'm trying to make migrations on my Flask api based on SQLite db. Here is my project structure ├── app.py ├── blueprints ├── conf.py ├── db.sqlite ├── __init__.py ├── migrations ├── models.py └── templates Then i initialize my migrate class in the app.py from flask import Flask, jsonify, request, render_template from flask_sqlalchemy import SQLAlchemy from conf import ErrorResponses, SuccessResponses # initialization app = Flask(__name__) db = SQLAlchemy(app) from models import User, db,