importerror

wxPython import error

六月ゝ 毕业季﹏ 提交于 2019-12-03 12:03:07
问题 I'm having trouble figuring out an error message in Python. yesterday, I've installed python using the latest EPD package, and wxPython2.9 using the wxPython2.9-osx-cocoa-py2.7 package for Mac OS. I then added wx to my PYTHONPATH. export WXDIR=/usr/local/lib/wxPython-2.9.1.1/lib/python2.7/site-packages/wx-2.9.1-osx_cocoa export PYTHONPATH=$WXDIR export PYTHONPATH=$PYTHONPATH:$WXDIR/tools but when I try to run stuff I get this error: In [14]: import matplotlib.pyplot --------------------------

Relative import problems in Python 3

我与影子孤独终老i 提交于 2019-12-03 11:08:34
Python imports drive me crazy (my experience with python imports sometime doesn't correspond at all to idiom 'Explicit is better than implicit' :( ): [app] start.py from package1 import module1 [package1] __init__.py print('Init package1') module1.py print('Init package1.module1') from . import module2 module2.py print('Init package1.module2') import sys, pprint pprint.pprint(sys.modules) from . import module1 I get: vic@ubuntu:~/Desktop/app2$ python3 start.py Init package1 Init package1.module1 Init package1.module2 {'__main__': <module '__main__' from 'start.py'>, ... 'package1': <module

How to import python file located in same subdirectory in a pycharm project

我只是一个虾纸丫 提交于 2019-12-03 10:34:49
问题 I have an input error in pycharm when debugging and running. My project structure is rooted properly, etc./HW3/. so that HW3 is the root directory. I have a subfolder in HW3, util , and a file, util/util.py . I have another file in util called run_tests.py . In run_tests.py , I have the following import structure, from util.util import my_functions, etc. This yields an input error, from util.util import load_dataset,proportionate_sample ImportError: No module named 'util.util'; 'util' is not

Can't import Webkit from gi.repository

*爱你&永不变心* 提交于 2019-12-03 09:04:53
问题 When I try to import Webkit from gi.repository , it gives an ImportError : from gi.repository import Webkit ERROR:root:Could not find any typelib for Webkit Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name Webkit What am I doing wrong? 回答1: Your error seems a typo and the library is not found for that. You have to put "WebKit" instead of "Webkit". Additionaly if you use Ubuntu check the library existence with: $ locate girepository | grep

Bizarre error importing settings in django

我是研究僧i 提交于 2019-12-03 06:52:55
I have many projects working in ubuntu with python2.7 and virtualenv/virtualenvwrapper, in my work some developers works with macosx and windows, generally I create the project as usual: django-admin.py start project x And we use svn for cvs, but in some point, without nothing rational for me, when I try something like: python manage.py runserver doesn't work, but is just for me and is in my laptop, that doesn't happens in productions servers or another developers. any ideas? I got this error: Error: Can't find the file 'settings.py' in the directory containing 'manage.py'. It appears you've

ImportError: libcblas.so.3: cannot open shared object file: No such file or directory

情到浓时终转凉″ 提交于 2019-12-03 06:02:53
I am trying to run an Arducam MT9J001 camera on a raspberry pi 3b+. I am getting the following error when I try to run the program, "ImportError: libcblas.so3: cannot open shared object file: No such file or directory." I have the computer vision software downloaded onto the raspberry pi, though it seems that it is still not working. I'm not sure what other information is viable to this project, but if there is something else I should be specifying please let me know. Thanks in advance! What worked for me (I was missing some dependencies): pip3 install opencv-python sudo apt-get install

ImportError: cannot import name get_column_letter

落爺英雄遲暮 提交于 2019-12-03 05:44:08
问题 I am able to use openpyxl as an import in my code. But when I try to do the following: from openpyxl.cell import get_column_letter I get the following error: ImportError: cannot import name get_column_letter I am using python 2.7. I have installed it using easy_install . Tried searching for this issue but couldn't find anything related to it. 回答1: The function get_column_letter has been relocated in Openpyxl version 2.4 from openpyxl.cell to openpyxl.utils . The current import is: from

Python package import from parent directory

痴心易碎 提交于 2019-12-03 04:47:54
I've the following source code structure /testapp/ /testapp/__init__.py /testapp/testmsg.py /testapp/sub/ /testapp/sub/__init__.py /testapp/sub/testprinter.py where testmsg defines the following constant: MSG = "Test message" and sub/testprinter.py : import testmsg print("The message is: {0}".format(testmsg.MSG)) But I'm getting ImportError: No module named testmsg Shouldn't it be working since the package structure? I don't really want to extend sys.path in each submodule and I don't even want to use relative import. What am I doing wrong here? It all depends on which script you run . That

Django, ImportError: cannot import name Celery, possible circular import?

偶尔善良 提交于 2019-12-03 04:43:27
问题 I went through this example here: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html All my tasks are in files called tasks.py. After updating celery and adding the file from the example django is throwing the following error, no matter what I try: ImportError: cannot import name Celery Is the problem possibly caused by the following? app.autodiscover_tasks(settings.INSTALLED_APPS, related_name='tasks') Because it goes through all tasks.py files which all have the

How can i import urlparse in python-3? [duplicate]

会有一股神秘感。 提交于 2019-12-03 04:20:23
This question already has an answer here: no module named urllib.parse (How should I install it?) 11 answers I would like to use urlparse . But python3.4.1 is not finding the module. I do import urlparse , but it gives me this error importError: no 'module' named ulrparse The urlparse in Python 2.7.11 was renamed to urllib.parse in Python 3. So, if you have a code such from urlparse import urljoin , I suggest you change it to from urllib.parse import urljoin As noted in urlparse 's documentation : Note The urlparse module is renamed to urllib.parse in Python 3. The 2to3 tool will automatically