GVKun编程网logo

升级Linux SDK之后,“导入错误:没有名为webapp2的模块”(1.9.35-> 1.9.38)(没有找到名称为default的数据源)

25

最近很多小伙伴都在问升级LinuxSDK之后,“导入错误:没有名为webapp2的模块”和1.9.35->1.9.38这两个问题,那么本篇文章就来给大家详细解答一下,同时本文还将给你拓展DeepSpe

最近很多小伙伴都在问升级Linux SDK之后,“导入错误:没有名为webapp2的模块”1.9.35-> 1.9.38这两个问题,那么本篇文章就来给大家详细解答一下,同时本文还将给你拓展DeepSpeech安装错误:“导入错误:DLL加载失败:找不到指定的模块”、Django-导入错误:没有名为* .urls的模块、PyInstaller - 导入错误:没有名为 _bootlocale 的模块、python 3.8中的导入错误:没有名为“_abc”的模块等相关知识,下面开始了哦!

本文目录一览:

升级Linux SDK之后,“导入错误:没有名为webapp2的模块”(1.9.35-> 1.9.38)(没有找到名称为default的数据源)

升级Linux SDK之后,“导入错误:没有名为webapp2的模块”(1.9.35-> 1.9.38)(没有找到名称为default的数据源)

将我的GAE Python Linux SDK从1.9.35版本升级到1.9.38后,我的应用程序停止运行,所有请求均以类似方式失败:

ERROR    2016-06-10 17:55:06,100 wsgi.py:263] Traceback (most recent call last):  File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())  File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler    handler, path, err = LoadObject(self._handler)  File "/usr/local/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject    obj = __import__(path[0])  File "/home/dancorn/src/apartsw/main/main.py", line 9, in <module>    import webapp2ImportError: No module named webapp2INFO     2016-06-10 17:55:06,102 module.py:788] default: "GET / HTTP/1.1" 500 -

我首先以为我搞砸了我的PyCharm配置,但是简单地回滚到1.9.35(通过将我的/usr/local/google_appengine符号链接指向相应的SDK版本目录)可以使一切恢复正常。

该SDK发行说明似乎并没有标明相关的任何东西。

我发现了一个类似的报告,但是建议的修复(回滚)在接下来的工作中并不是真正可以接受的。

我也找到了这篇文章,但没有安装protobuf(明确地):升级Google App
Engine启动器后如何解决webapp2导入错误?。仍在仔细阅读相关文章,以使我了解到SDK中可能存在的相关差异,接下来我将对其进行调查:

diff google_appengine_1.9.35/_python_runtime.py google_appengine_1.9.38/_python_runtime.py71a72,75>   if ''google'' in sys.modules:>     google_path = os.path.join(os.path.dirname(__file__), ''google'')>     google_module = sys.modules[''google'']>     google_module.__path__.append(google_path)74,77c78< < <   if ''google'' in sys.modules:<     del sys.modules[''google'']--->     google_module.__file__ = google_path

还有其他调查线索吗?

答案1

小编典典

更新:此问题已在SDK版本1.9.40中修复。

该问题已为Google所知,已在1.9.37中引入:

  • 确认的报告具有更多信息
  • 跟踪为GAE第12963期。

根据Jon Parrot的说法,来自报告线程:

感谢大家举报。我们已重现了该问题,并且已收到修复程序。它不会在下一个SDK版本(38)中出现,但可能会在39或40中出现。

在发布此修补程序之前,可以在此处找到较早的不受影响的SDK版本(如1.9.36)。

DeepSpeech安装错误:“导入错误:DLL加载失败:找不到指定的模块”

DeepSpeech安装错误:“导入错误:DLL加载失败:找不到指定的模块”

您缺少一些依赖项,请按照以下步骤进行操作-您会很好的。

您可以使用conda虚拟环境代替python virtualenv。

# Create and activate a virtualenv
virtualenv -p python3 $HOME/tmp/deepspeech-venv/
source $HOME/tmp/deepspeech-venv/bin/activate

# Install DeepSpeech
pip3 install deepspeech

# Download pre-trained English model files
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.8.1/deepspeech-0.8.1-models.pbmm
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.8.1/deepspeech-0.8.1-models.scorer

# Download example audio files
curl -LO https://github.com/mozilla/DeepSpeech/releases/download/v0.8.1/audio-0.8.1.tar.gz
tar xvf audio-0.8.1.tar.gz

# Transcribe an audio file
deepspeech --model deepspeech-0.8.1-models.pbmm --scorer deepspeech-0.8.1-models.scorer --audio audio/2830-3980-0043.wav

注意-如果可能,请尝试使用新的虚拟环境。

Django-导入错误:没有名为* .urls的模块

Django-导入错误:没有名为* .urls的模块

我正在研究官方的Django教程,并使用Django
1.6.1版,Python 2.7.6对其稍作调整以适应我的需要。

我正要映射URL,但是当很明显其中有一个模块具有适当命名的文件时,我会不断收到“无模块命名为customers.urls”的错误,所以我真的迷失了什么我做错了

我最初的想法是,我需要在root / urls.py中导入与客户相关的内容,但是每种导入组合都会导致大致相同的错误,并且本教程没有说要这样做。

ROOT_URLCONF =’taco.urls’(taco是项目的名称)

我正在使用manage.py/runserver运行此程序,因此我知道并没有发生任何特殊的Web服务器骗局。我已经重启了好几次。

追溯可以证明,所有应用程序都已正确注册。

任何关于我忽略的东西的指针将不胜感激!

root / urls.py:

from django.conf.urls import patterns,include,url
from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns('',url(r'^customers/',include('customers.urls')),url(r'^admin/',include(admin.site.urls)),)

客户/urls.py:

from django.conf.urls import patterns,url;

from customers import views;

urlpatterns = ('',url(r'^$',views.index,name='index')
);

客户/views.py:

from django.shortcuts import render
from django.http import HttpResponse;

def index(request):
    return HttpResponse("Hello");

追溯

Environment:


Request Method: GET
Request URL: http://192.168.3.208:8000/customers/

Django Version: 1.6.1
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','south','taco.customers','taco.inventory','taco.lookups','taco.orders')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware','django.middleware.common.CommonMiddleware','django.middleware.csrf.CsrfViewMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','django.middleware.clickjacking.XFrameOptionsMiddleware')


Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  99.                 resolver_match = resolver.resolve(request.path_info)
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
  337.             for pattern in self.url_patterns:
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in url_patterns
  365.         patterns = getattr(self.urlconf_module,"urlpatterns",self.urlconf_module)
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in urlconf_module
  360.             self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py" in import_module
  40.         __import__(name)
File "/var/project/taco/taco/urls.py" in <module>
  7.     url(r'^customers/',File "/usr/lib/python2.7/dist-packages/django/conf/urls/__init__.py" in include
  26.         urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py" in import_module
  40.         __import__(name)

Exception Type: ImportError at /customers/
Exception Value: No module named customers.urls

PyInstaller - 导入错误:没有名为 _bootlocale 的模块

PyInstaller - 导入错误:没有名为 _bootlocale 的模块

如何解决PyInstaller - 导入错误:没有名为 _bootlocale 的模块?

每次我尝试在 PyInstaller 中编译 python 文件时,它都会返回很多错误。

这些是编译错误...

Traceback (most recent call last):
  File "c:\users\Person\appdata\local\programs\python\python310\lib\runpy.py",line 197,in _run_module_as_main
    return _run_code(code,main_globals,None,File "c:\users\Persong\appdata\local\programs\python\python310\lib\runpy.py",line 87,in _run_code
    exec(code,run_globals)
  File "C:\Users\Person\AppData\Local\Programs\Python\python310\Scripts\pyinstaller.exe\__main__.py",line 7,in <mo
dule>
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\__main__.py",line 114,in run
    run_build(pyi_config,spec_file,**vars(args))
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\__main__.py",line 65,in run_build
    PyInstaller.building.build_main.main(pyi_config,**kwargs)
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\building\build_main.py
",line 725,in main
    build(specfile,kw.get(''distpath''),kw.get(''workpath''),kw.get(''clean_build''))
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\building\build_main.py
",line 672,in build
    exec(code,spec_namespace)
  File "E:\___Python___\auto.spec",line 6,in <module>
    a = Analysis([''auto.py''],File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\building\build_main.py
",line 242,in __init__
    self.__postinit__()
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\building\datastruct.py
",line 160,in __postinit__
    self.assemble()
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\building\build_main.py
",line 341,in assemble
    self.graph = initialize_modgraph(
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\depend\analysis.py",l
ine 799,in initialize_modgraph
    graph = PyiModuleGraph(
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\depend\analysis.py",l
ine 120,in __init__
    self._analyze_base_modules()
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\depend\analysis.py",l
ine 288,in _analyze_base_modules
    self._base_modules = [mod
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\depend\analysis.py",l
ine 290,in <listcomp>
    for mod in self.import_hook(req)]
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\lib\modulegraph\module
graph.py",line 1496,in import_hook
    target_package,target_module_partname = self._find_head_package(
  File "c:\users\Person\appdata\local\programs\python\python310\lib\site-packages\PyInstaller\lib\modulegraph\module
graph.py",line 1681,in _find_head_package
    raise ImportError("No module named " + target_package_name)
ImportError: No module named _bootlocale

我关注的主要错误之一如下...

raise ImportError("No module named " + target_package_name)
ImportError: No module named _bootlocale

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

python 3.8中的导入错误:没有名为“_abc”的模块

python 3.8中的导入错误:没有名为“_abc”的模块

如何解决python 3.8中的导入错误:没有名为“_abc”的模块?

我在尝试构建 cura-build-environment 时遇到问题,在构建文件中运行 sudo make 后我得到了这个..

 [ 43%] Performing configure step for ''Savitar''
-- Find shared libpython: /usr/local/lib/libpython3.8.so
Fatal Python error: Py_Initialize: can''t initialize sys standard streams
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/abc.py",line 64,in <module>
ImportError: No module named ''_abc''

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/io.py",line 52,in <module>
  File "/usr/local/lib/python3.8/abc.py",line 68,in <module>
  File "/usr/local/lib/python3.8/_py_abc.py",line 35
    def __new__(mcls,name,bases,namespace,/,**kwargs):
                                              ^
SyntaxError: invalid Syntax
CMake Error at cmake/FindSIP.cmake:47 (message):
  Failed to get python3_SITELIB.  Error:
Call Stack (most recent call first):
  CMakeLists.txt:48 (find_package)


-- Configuring incomplete,errors occurred!

我尝试重新安装 python3.8,但仍然没有运气。 这是 Savitar 的 CMakeLists.txt 的片段,我认为这是导致问题的原因:

project(savitar)
cmake_minimum_required(VERSION 3.8)    
##### find python
execute_process(COMMAND python3-config --prefix OUTPUT_VARIABLE PYTHON_SEARCH_PATH)
string(REGEX REPLACE "\n$" "" PYTHON_SEARCH_PATH "${PYTHON_SEARCH_PATH}")
file(GLOB_RECURSE PYTHON_DY_LIBS ${PYTHON_SEARCH_PATH}/lib/libpython*.dylib ${PYTHON_SEARCH_PATH}/lib/libpython*.so)
if (PYTHON_DY_LIBS)
    list(GET PYTHON_DY_LIBS 0 PYTHON_LIBRARY)
    message("-- Find shared libpython: ${PYTHON_LIBRARY}")
else()
    message(WARNING "Cannot find shared libpython,try find_package")
endif()#####

if(BUILD_PYTHON)
    list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

    # FIXME: Remove the code for CMake <3.12 once we have switched over completely.
    # Findpython3 is a new module since CMake 3.12. It deprecates FindPythonInterp and FindPythonLibs.
    if(${CMAKE_VERSION} VERSION_LESS 3.12)
        # FIXME: Use Findpython3 to find Python,new in CMake 3.12.
        # However currently on our CI server it finds the wrong Python version and then doesn''t find the headers.
        find_package(PythonInterp 3.4 required)
        find_package(PythonLibs 3.4 required)
    find_package(python3_EXECUTABLE Interpreter)
    else()
        # Use Findpython3 for CMake >=3.12
        find_package(python3 3.4 required COMPONENTS Interpreter Development)

    endif()

    find_package(SIP required)
    if(NOT DEFINED LIB_SUFFIX)
        set(LIB_SUFFIX "")
    endif()

    include_directories(python/ src/ ${SIP_INCLUDE_Dirs} ${python3_INCLUDE_Dirs})
endif()

更新

如果我没记错的话,问题来自 SIP 包,因为这是 cmakefile 给出错误的地方! 在 find_package(SIP required) 如果我尝试卸载 sip,它会显示 sip 的位置在 .local/python3.5 中!这可能是问题?但解决方案是什么??

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

今天的关于升级Linux SDK之后,“导入错误:没有名为webapp2的模块”1.9.35-> 1.9.38的分享已经结束,谢谢您的关注,如果想了解更多关于DeepSpeech安装错误:“导入错误:DLL加载失败:找不到指定的模块”、Django-导入错误:没有名为* .urls的模块、PyInstaller - 导入错误:没有名为 _bootlocale 的模块、python 3.8中的导入错误:没有名为“_abc”的模块的相关知识,请在本站进行查询。

本文标签: