我试图发布我的Project来实现蔚蓝,但是我得到了ImportError:没有名为的模块。在没有虚拟环境的情况下,这个项目工作得很好,如果没有虚拟环境,它就不能工作了,并且给了我这个错误。是的,所有的依赖都在驾驶室和在requirements.txt是-找到-链接轮屋。在有和没有ve的情况下,依赖项都是相同的。
`
--find-links wheelhouse
Flask==0.12.1
azure-storage-blob==0.37.0
azure-storage-file==0.37.0
azure-storage-queue==0.37.0
azure==2.0.0
azure-storage==0.34.3
azure-batch==4.0.0
azure-mgmt-scheduler==1.1.3
azure-mgmt-storage==1.0.0“请告诉我你还需要什么信息。谢谢!
编辑1:我输出Azure中的日志:
D:\home\site\wwwroot>cat logs.txt
2017-10-07 16:08:25.674062: wfastcgi.py 2.1.1 started
2017-10-07 16:08:25.689690: Python version: 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)]
2017-10-07 16:08:25.689690: wfastcgi.py 2.1.1 initializing
2017-10-07 16:08:25.737007: Activating venv with executable at D:\home\site\wwwroot\env\Scripts\python.exe
2017-10-07 16:08:26.886554: Getting handler main.app
2017-10-07 16:08:31.038583: Error occurred while reading WSGI handler:
Traceback (most recent call last):
File "D:\Python34\Scripts\wfastcgi.py", line 711, in main
env, handler = read_wsgi_handler(response.physical_path)
File "D:\Python34\Scripts\wfastcgi.py", line 568, in read_wsgi_handler
return env, get_wsgi_handler(handler_name)
File "D:\Python34\Scripts\wfastcgi.py", line 541, in get_wsgi_handler
handler = handler()
File ".\virtualenv_proxy.py", line 93, in get_venv_handler
handler = get_wsgi_handler(os.getenv('WSGI_ALT_VIRTUALENV_HANDLER'))
File ".\virtualenv_proxy.py", line 62, in get_wsgi_handler
raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))
ValueError: "main.app" could not be imported: Traceback (most recent call last):
File ".\virtualenv_proxy.py", line 46, in get_wsgi_handler
handler = __import__(module_name, fromlist=[name_list[0][0]])
File "D:\home\site\wwwroot\main.py", line 3, in <module>
from azure.storage.table import TableService, Entity
File "D:\home\site\wwwroot\env\lib\site-packages\azure\storage\table\__init__.py", line 26, in <module>
from .tableservice import TableService
File "D:\home\site\wwwroot\env\lib\site-packages\azure\storage\table\tableservice.py", line 82, in <module>
from ..sharedaccesssignature import (
ImportError: No module named 'azure.storage.sharedaccesssignature'
StdOut:
StdErr:
2017-10-07 16:08:31.055892: Unhandled exception in wfastcgi.py: Traceback (most recent call last):
File "D:\Python34\Scripts\wfastcgi.py", line 711, in main
env, handler = read_wsgi_handler(response.physical_path)
File "D:\Python34\Scripts\wfastcgi.py", line 568, in read_wsgi_handler
return env, get_wsgi_handler(handler_name)
File "D:\Python34\Scripts\wfastcgi.py", line 541, in get_wsgi_handler
handler = handler()
File ".\virtualenv_proxy.py", line 93, in get_venv_handler
handler = get_wsgi_handler(os.getenv('WSGI_ALT_VIRTUALENV_HANDLER'))
File ".\virtualenv_proxy.py", line 62, in get_wsgi_handler
raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))
ValueError: "main.app" could not be imported: Traceback (most recent call last):
File ".\virtualenv_proxy.py", line 46, in get_wsgi_handler
handler = __import__(module_name, fromlist=[name_list[0][0]])
File "D:\home\site\wwwroot\main.py", line 3, in <module>
from azure.storage.table import TableService, Entity
File "D:\home\site\wwwroot\env\lib\site-packages\azure\storage\table\__init__.py", line 26, in <module>
from .tableservice import TableService
File "D:\home\site\wwwroot\env\lib\site-packages\azure\storage\table\tableservice.py", line 82, in <module>
from ..sharedaccesssignature import (
ImportError: No module named 'azure.storage.sharedaccesssignature'
2017-10-07 16:08:31.069837: wfastcgi.py 2.1.1 closed发布于 2017-10-09 15:22:12
在使用存储包0.37时,这个类已移到azure.storage.common:
https://github.com/Azure/azure-storage-python/blob/master/BreakingChanges.md#version-0370
坚持0.36或升级代码以使用新的命名。
https://stackoverflow.com/questions/46623198
复制相似问题