importerror

python 3.5 in statsmodels ImportError: cannot import name '_representation'

那年仲夏 提交于 2019-12-12 08:47:21
问题 I cannot manage to import statsmodels.api correctly when i do that I have this error: File "/home/mlv/.local/lib/python3.5/site-packages/statsmodels/tsa/statespace/tools.py", line 59, in set_mode from . import (_representation, _kalman_filter, _kalman_smoother, ImportError: cannot import name '_representation' I already try to re-install or update it, that does not change. plese i need help =) 回答1: Please see the github report for more detail. It turns out that statsmodels is dependent upon

Create-React-App failed to compile | Import/First Error

被刻印的时光 ゝ 提交于 2019-12-12 07:15:01
问题 I'm currently using Create-React-App for my personal site. I keep getting the following errors every time I run it: ./src/~/react-router-dom/es/index.js Line 3: Import in body of module; reorder to top import/first Line 5: Import in body of module; reorder to top import/first Line 7: Import in body of module; reorder to top import/first Line 9: Import in body of module; reorder to top import/first Line 11: Import in body of module; reorder to top import/first Line 13: Import in body of module

Why is matplotlib failing on import matplotlib.pyplot as plt

亡梦爱人 提交于 2019-12-12 06:38:31
问题 I installed matplotlib using conda : conda install matplotlib The following code failed: #!/usr/bin/env python import matplotlib import matplotlib.pyplot as plt With this error message: "ImportError: No module named 'matplotlib.pyplot'" I tried installing matplotlib with apt-get : sudo apt-get install python3-matplotlib I got the same error. I tried loading matplotlib with ubuntu application load and got the same error. I tried cloning from GitHub with: git clone git://github.com/matplotlib

Tried to use relative imports, and broke my import paths?

拥有回忆 提交于 2019-12-12 06:24:46
问题 I'm running a Flask server locally on my Mac. My project: project/my_lib/my_class.py project/testing/flask_server.py project/testing/something/test_class.py At one point, I tried to get fancy with some relative imports to test a class in a different directory: In project/testing/something/test_class.py: from ..my_lib.my_class import MyClass That gave me an error: ValueError: Attempted relative import beyond toplevel package So I backed out of that, but now I can't get my Flask server to run ,

import gtk not working on mac

泪湿孤枕 提交于 2019-12-12 04:58:23
问题 I am new to Python and mac OS. I've Installed py27-pygtk-2.24.0_3 from macports . I tried to run the following: #!/opt/local/bin/python2.7 import gtk window=gtk.Window() window.connect("destroy", gtk.main_quit) button=gtk= gtk.Button("Hello") window.add(button) window.show_all()\gtk.main() I am executing the file through Python Launcher and get this error: Import error:No module named GTK I spent the whole day searching for answer. Can someone help me and make it work? 回答1: First of all, you

Cannot import name StringIO when importing dateutil

老子叫甜甜 提交于 2019-12-12 04:36:48
问题 I'm having a 'Cannot import name StringIO' error message when importing dateutil which tries to import StringIO but cannot find it. Here is complete trace: (DEV)arbi@el-oued:~/Work/sentimentpy$ python core/main.py Traceback (most recent call last): File "core/main.py", line 7, in <module> from io.reader import * File "/home/arbi/Work/sentimentpy/core/io/reader.py", line 4, in <module> from dateutil import parser File "/home/arbi/DEV/local/lib/python2.7/site-packages/dateutil/parser.py", line

python ImportError: cannot import name [duplicate]

被刻印的时光 ゝ 提交于 2019-12-12 03:55:44
问题 This question already has answers here : Two Python modules require each other's contents - can that work? (2 answers) Closed 2 years ago . My code is a bit complex so i'll show an example: file A.py: from B import B class A(): def __init__(self): self.id = 5 self.b = B() file B.py from A import A class B(): def __init__(self): self.id = 15 self.a = A() This is the exception i get: Traceback (most recent call last): File "F:/Project/Code/A.py", line 1, in <module> from B import B File "F:

python ImportError: No module named primes

会有一股神秘感。 提交于 2019-12-12 01:56:01
问题 I'm really new to Python. I'm trying to import a third party module called primes.py. I have placed this module in C:\Python26\Lib (the location where I installed Python). I then have another file which is trying to import this module. The file attempting to import primes is located at C:\Python26. In my Python file I have the following two lines: import primes import sys When I run this file, I get the following error: ImportError: No module named primes Can anyone help me out? 回答1: Put

Failure to import numpy in Jupyter notebook

≯℡__Kan透↙ 提交于 2019-12-11 23:09:05
问题 I am new to iPython/Jupyter. Python skills limited, but learning. I am trying to import numpy as np and get the following: --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-1-4ee716103900> in <module>() ----> 1 import numpy as np /Users/jmmiii/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/numpy/__init__.py in <module>() 166 return loader(*packages, **options) 167 --> 168 from . import add

ImportError: No module named pymysql in python 2.7

谁说胖子不能爱 提交于 2019-12-11 17:19:11
问题 I have flask web application running on aws, my app.py file gives error for "import pymysql" line (whole application is working fine.) Error.log [Sat Jul 29 06:12:54.545904 2017] [wsgi:error] [pid 28317:tid 140546426812160] [client ] ImportError: No module named pymysql Python version is - 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] I created test.py file and executed, it worked and displays rows from database which is on RDS , So no idea why same thing is not working on app