importerror

Flask app can't find module when deployed to azure - works fine locally

我与影子孤独终老i 提交于 2019-12-11 15:44:30
问题 Azure gives a module import error but the same code runs perfectly locally. 2019-05-29T02:50:47.388004719Z: [ERROR] Traceback (most recent call last): 2019-05-29T02:50:47.388027419Z: [ERROR] File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker 2019-05-29T02:50:47.388031719Z: [ERROR] worker.init_process() 2019-05-29T02:50:47.388035419Z: [ERROR] File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process 2019-05-29T02

Import specific method signature in Scala

天涯浪子 提交于 2019-12-11 14:26:03
问题 Is there a manner to import a specific method signature? def test() { lazy val log = LoggerFactory.getLogger("AndroidProxy") import log.{error, debug, info, trace} trace("This is a test") trace "This is also" // <- This line will not compile } Perhaps it's not possible, but my primary goal is to allow this without adding in a new method. I've tried these to no avail import log.{error => error(_:String)} import log.{error(x: String) => error(x)} I suppose the primary challenge is that all of

Import error with module _ssl for Python 3.3

醉酒当歌 提交于 2019-12-11 13:23:06
问题 I am programming in Python 3.3 on the latest version of Ubuntu. I am writing code for a project involving a library that works with Twitter. Here is the output from the terminal I have: Traceback (most recent call last): File "tryout.py", line 2, in <module> import twitter File "/home/owner/Documents/twitter/__init__.py", line 15, in <module> from .stream import TwitterStream File "/home/owner/Documents/twitter/stream.py", line 9, in <module> from ssl import SSLError File "/usr/local/lib

How can I get rid of ft2font import error from matplotlib on a Windows XP source installation?

。_饼干妹妹 提交于 2019-12-11 08:28:13
问题 So today I tried building matplotlib from source (git clone) on a Windows XP box. First I downloaded and compiled the dependencies (zlib, libpng, freetype2) as per this blog entry. I then edited setup.cfg to make the matplotlib installation aware of the installations of the dependencies. Lastly, python setup.py build and python setup.py install ran without any errors. But when I try a simple script for a sample plot, I get this error: File "C:\Python27\lib\site-packages\matplotlib\font

ImportError : cannot import name timezone pythonanywhere

╄→гoц情女王★ 提交于 2019-12-11 05:19:35
问题 I am attempting to use collectstatic in the bash console to get my CSS running on a django app on pythonanywhere. Unfortunately, I am getting an error: 23:49 ~/mysite/mysite $ python manage.py collectstatic Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 429, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist

Import error aftert adding site.py file to project

℡╲_俬逩灬. 提交于 2019-12-11 04:12:56
问题 After I've added site.py to top directory of my project, my application started to fail with an exception: "ImportError: No module named 'bs4'" . Before adding this file, application worked file. BeautifulSoup4 package is installed in used interpreter. What's happening here? 回答1: site.py shadows built-in site module. Due to wrong site.py module being imported, paths used to search for user-installed packages are never set, therefore interpreter is unable to find bs4 module. 来源: https:/

Python ImportError when calling Python script from Java

旧时模样 提交于 2019-12-11 03:56:42
问题 First off, there is a similar question here that wasn't ever really resolved. I have a Python script that I want to execute from within my Java code. When I run the Python script on its own, it works properly. When I try to execute it from a Java process, I get an ImportError: Traceback (most recent call last): File "address_to_geocode.py", line 3, in <module> from omgeo import Geocoder ImportError: No module named omgeo Per a suggestion from the linked question, I appended a direct path to

ImportError on Cython submodule

坚强是说给别人听的谎言 提交于 2019-12-11 02:54:47
问题 I don't understand how to make Cython correctly build a single .pyd out of a module with submodules. The current setup.py gives me import error on the submodule. I have the setup given below the rule, and I move both cythontest.pyd and submod.pyd to another folder and start the interpreter there. Unfortunately I get this error: Traceback (most recent call last): File "<string>", line 1, in <module> File "__init__.py", line 1, in init cythontest (cythontest\__init__.c:981) ImportError: No

Virtualenv __future__ module works on command line, but not while running dev_appserver.py

。_饼干妹妹 提交于 2019-12-10 23:30:04
问题 I'm running into a strange error when running App Engine from within my virtualenv . Here is the error: File "/home/matthew/dev/sdks/google_appengine_1.5.2/google/appengine/tools/dev_appserver.py", line 2318, in LoadModuleRestricted description) File "/home/matthew/dev/projects/webapp2/project/src/webapp2.py", line 11, in <module> from __future__ import with_statement ImportError: No module named __future__ If I run python in my virtualenv and type import __future__ , it imports. If I

ImportError for Gnuplot in python terminal

此生再无相见时 提交于 2019-12-10 21:03:37
问题 I have Gnuplot 4.2 patchlevel 6 installed on my Centos 6 system. However, whenever I try importing Gnuplot in the python terminal, I get an error message which says that there is no module named Gnuplot: '>>> import Gnuplot Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named Gnuplot` Please help. Thanks. 回答1: try: pip install gnuplot-py If it does not work, try downloading the package from http://gnuplot-py.sourceforge.net/ and install it. 回答2: