microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.34k stars 1.19k forks source link

VSC 1.40.0 reporting ModuleNotFoundError for module that clearly exists #8592

Closed dxkaufman closed 5 years ago

dxkaufman commented 5 years ago

Environment data

Other extensions: Azure Account 0.8.7 Azure App Service 0.16.1 Azure Functions 0.20.0 Azure Storage 0.7.2 Azure Storage Explorer 0.1.2 Git History 0.4.6 SQL Server (mssql) 1.7.0

pip freeze output at the very end of the ticket.

Expected behaviour

Code should execute while Azure attached. I also filed this in Stack Overflow yesterday, as well as a ticket with Azure support - I'm stuck in the water and can't finalize my testing and upload to my production services. https://stackoverflow.com/questions/58842695/vscode-running-python-azure-function-locally-fails-with-modulenotfounderror I apologize if this isn't the right place for this post...

Actual behaviour

On timer trigger or https trigger, while Azure attached, I receive this error message:

[11/14/19 5:38:07 PM] Executed 'Functions.DataPipeline' (Failed, Id=fcdcceb2-d82f-46a6-8f9f-7f0c0d82789b)
[11/14/19 5:38:07 PM] System.Private.CoreLib: Exception while executing function: Functions.DataPipeline. System.Private.CoreLib: Result: Failure
[11/14/19 5:38:07 PM] Exception: ModuleNotFoundError: No module named 'SharedCode'
[11/14/19 5:38:07 PM] Stack: File '/usr/local/Cellar/azure-functions-core-tools/2.7.1846/workers/python/3.6/OSX/X64/azure_functions_worker/dispatcher.py', line 242, in _handle__function_load_request
[11/14/19 5:38:07 PM] func_request.metadata.entry_point)
[11/14/19 5:38:07 PM] File '/usr/local/Cellar/azure-functions-core-tools/2.7.1846/workers/python/3.6/OSX/X64/azure_functions_worker/loader.py', line 66, in load_function
[11/14/19 5:38:07 PM] mod = importlib.import_module(fullmodname)
[11/14/19 5:38:07 PM] File '/Users/dylankaufman/Documents/Projects/SuccessHacker/Data Pipeline/env/lib/python3.6/importlib/__init__.py', line 126, in import_module
[11/14/19 5:38:07 PM] return _bootstrap._gcd_import(name[level:], package, level)
[11/14/19 5:38:07 PM] File '/Users/dylankaufman/Documents/Projects/SuccessHacker/Data Pipeline/DataPipeline/etl.py', line 6, in <module>
[11/14/19 5:38:07 PM] from SharedCode import FunctionApp
[11/14/19 5:38:07 PM] .

Steps to reproduce:

Relevant directory structure:

env
DataPipeline
   etl.py
   function.json
SharedCode
   FunctionApp.py

function.json contains the following:

{
  "scriptFile": "etl.py",
  "bindings": [
    {
      "name": "MainETL",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "45 0 * * * *",
      "_comment-test-schedule" : "*/10 * * * * *",
      "_comment-hourly-schedule" : "0 0 * * * *"
    }
  ]
}

etl.py includes the following imports:

import datetime import logging import azure.functions as func import pandas as pd import sqlalchemy from SharedCode import FunctionApp from SharedCode import APIs

etl.py also contains a variable & two functions that start with the same line:

functionName = "Data Pipeline"

def main(MainETL: func.TimerRequest) -> None:
    app = FunctionApp.FunctionApp(functionName, datetime.datetime.utcnow())

def Test():
    app = FunctionApp.FunctionApp(functionName, datetime.datetime.utcnow())
    print(app.functionName)

Note that function main includes a lot of other code not shown here; Test only includes the two lines above.

Function main is called when executed while Azure attached and as soon as the timer fires, it generates the ModuleNotFoundError for the first "from SharedCode" import. I created function Test to be able to test for the same problem from the command line, which works:

(env) Dylans-iMac:Data Pipeline dylankaufman$ python3
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from DataPipeline import etl
>>> etl.Test()
Data Pipeline
>>> 

Other than upgrading to VSC 1.40.0 and, I think, applying an azure core tools update, nothing has changed since I was last able to execute this properly while Azure attached.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

None

Complete output in Terminal for Task - host start:

> Executing task: env/bin/python -m pip install -r requirements.txt <

Requirement already satisfied: azure-storage-blob in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (1.5.0)
Requirement already satisfied: certifi in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (2019.3.9)
Requirement already satisfied: chardet in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 3)) (3.0.4)
Requirement already satisfied: grpcio-tools==1.14.2 in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 4)) (1.14.2)
Requirement already satisfied: grpcio==1.14.2 in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 5)) (1.14.2)
Requirement already satisfied: idna in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 6)) (2.8)
Requirement already satisfied: numpy in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 7)) (1.16.2)
Requirement already satisfied: pandas in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 8)) (0.24.2)
Requirement already satisfied: protobuf==3.7.0 in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 9)) (3.7.0)
Requirement already satisfied: pycryptodome in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 10)) (3.8.1)
Requirement already satisfied: pyodbc in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 11)) (4.0.26)
Requirement already satisfied: python-dateutil in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 12)) (2.8.0)
Requirement already satisfied: pytz in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 13)) (2018.9)
Requirement already satisfied: requests in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 14)) (2.21.0)
Requirement already satisfied: six in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 15)) (1.12.0)
Requirement already satisfied: SQLAlchemy in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 16)) (1.3.2)
Requirement already satisfied: urllib3==1.24.2 in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 17)) (1.24.2)
Requirement already satisfied: gspread in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 18)) (3.1.0)
Requirement already satisfied: oauth2client in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 19)) (4.1.3)
Requirement already satisfied: azure-common>=1.1.5 in ./env/lib/python3.6/site-packages (from azure-storage-blob->-r requirements.txt (line 1)) (1.1.23)
Requirement already satisfied: azure-storage-common~=1.4 in ./env/lib/python3.6/site-packages (from azure-storage-blob->-r requirements.txt (line 1)) (1.4.2)
Requirement already satisfied: setuptools in ./env/lib/python3.6/site-packages (from protobuf==3.7.0->-r requirements.txt (line 9)) (41.0.1)
Requirement already satisfied: httplib2>=0.9.1 in ./env/lib/python3.6/site-packages (from oauth2client->-r requirements.txt (line 19)) (0.13.0)
Requirement already satisfied: pyasn1-modules>=0.0.5 in ./env/lib/python3.6/site-packages (from oauth2client->-r requirements.txt (line 19)) (0.2.5)
Requirement already satisfied: pyasn1>=0.1.7 in ./env/lib/python3.6/site-packages (from oauth2client->-r requirements.txt (line 19)) (0.4.5)
Requirement already satisfied: rsa>=3.1.4 in ./env/lib/python3.6/site-packages (from oauth2client->-r requirements.txt (line 19)) (4.0)
Requirement already satisfied: cryptography in ./env/lib/python3.6/site-packages (from azure-storage-common~=1.4->azure-storage-blob->-r requirements.txt (line 1)) (2.6.1)
Requirement already satisfied: asn1crypto>=0.21.0 in ./env/lib/python3.6/site-packages (from cryptography->azure-storage-common~=1.4->azure-storage-blob->-r requirements.txt (line 1)) (0.24.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in ./env/lib/python3.6/site-packages (from cryptography->azure-storage-common~=1.4->azure-storage-blob->-r requirements.txt (line 1)) (1.12.3)
Requirement already satisfied: pycparser in ./env/lib/python3.6/site-packages (from cffi!=1.11.3,>=1.8->cryptography->azure-storage-common~=1.4->azure-storage-blob->-r requirements.txt (line 1)) (2.19)
source "/Users/dylankaufman/Documents/Projects/SuccessHacker/Data Pipeline/env/bin/activate"

Terminal will be reused by tasks, press any key to close it.

> Executing task: . env/bin/activate && func extensions install <

Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 24.09 ms for /Users/dylankaufman/Documents/Projects/SuccessHacker/Data Pipeline/extensions.csproj.
  extensions -> /Users/dylankaufman/Documents/Projects/SuccessHacker/Data Pipeline/bin/extensions.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.82

Terminal will be reused by tasks, press any key to close it.

> Executing task: . env/bin/activate && func host start <

Found Python version 3.6.5 (python).

                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %

Azure Functions Core Tools (2.7.1846 Commit hash: 458c671341fda1c52bd46e1aa8943cb26e467830)
Function Runtime Version: 2.0.12858.0
[11/14/19 6:12:31 PM] Building host: startup suppressed: 'False', configuration suppressed: 'False', startup operation id: 'bb6a5f79-1e24-4984-b756-4de96f353b7e'
[11/14/19 6:12:31 PM] Reading functions metadata
[11/14/19 6:12:31 PM] 1 functions found
[11/14/19 6:12:31 PM] Loading startup extension 'AzureStorage'
[11/14/19 6:12:31 PM] Loaded extension 'AzureStorage' (3.0.4.0)
[11/14/19 6:12:31 PM] Initializing Warmup Extension.
[11/14/19 6:12:31 PM] Initializing Host. OperationId: 'bb6a5f79-1e24-4984-b756-4de96f353b7e'.
[11/14/19 6:12:31 PM] Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=bb6a5f79-1e24-4984-b756-4de96f353b7e
[11/14/19 6:12:31 PM] LoggerFilterOptions
[11/14/19 6:12:31 PM] {
[11/14/19 6:12:31 PM]   "MinLevel": "None",
[11/14/19 6:12:31 PM]   "Rules": [
[11/14/19 6:12:31 PM]     {
[11/14/19 6:12:31 PM]       "ProviderName": null,
[11/14/19 6:12:31 PM]       "CategoryName": null,
[11/14/19 6:12:31 PM]       "LogLevel": null,
[11/14/19 6:12:31 PM]       "Filter": "<AddFilter>b__0"
[11/14/19 6:12:31 PM]     },
[11/14/19 6:12:31 PM]     {
[11/14/19 6:12:31 PM]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[11/14/19 6:12:31 PM]       "CategoryName": null,
[11/14/19 6:12:31 PM]       "LogLevel": "None",
[11/14/19 6:12:31 PM]       "Filter": null
[11/14/19 6:12:31 PM]     },
[11/14/19 6:12:31 PM]     {
[11/14/19 6:12:31 PM]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[11/14/19 6:12:31 PM]       "CategoryName": null,
[11/14/19 6:12:31 PM]       "LogLevel": null,
[11/14/19 6:12:31 PM]       "Filter": "<AddFilter>b__0"
[11/14/19 6:12:31 PM]     }
[11/14/19 6:12:31 PM]   ]
[11/14/19 6:12:31 PM] }
[11/14/19 6:12:31 PM] FunctionResultAggregatorOptions
[11/14/19 6:12:31 PM] {
[11/14/19 6:12:31 PM]   "BatchSize": 1000,
[11/14/19 6:12:31 PM]   "FlushTimeout": "00:00:30",
[11/14/19 6:12:31 PM]   "IsEnabled": true
[11/14/19 6:12:31 PM] }
[11/14/19 6:12:31 PM] SingletonOptions
[11/14/19 6:12:31 PM] {
[11/14/19 6:12:31 PM]   "LockPeriod": "00:00:15",
[11/14/19 6:12:31 PM]   "ListenerLockPeriod": "00:00:15",
[11/14/19 6:12:31 PM]   "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[11/14/19 6:12:31 PM]   "LockAcquisitionPollingInterval": "00:00:05",
[11/14/19 6:12:31 PM]   "ListenerLockRecoveryPollingInterval": "00:01:00"
[11/14/19 6:12:31 PM] }
[11/14/19 6:12:31 PM] QueuesOptions
[11/14/19 6:12:31 PM] {
[11/14/19 6:12:31 PM]   "BatchSize": 16,
[11/14/19 6:12:31 PM]   "NewBatchThreshold": 8,
[11/14/19 6:12:31 PM]   "MaxPollingInterval": "00:00:02",
[11/14/19 6:12:31 PM]   "MaxDequeueCount": 5,
[11/14/19 6:12:31 PM]   "VisibilityTimeout": "00:00:00"
[11/14/19 6:12:31 PM] }
[11/14/19 6:12:31 PM] BlobsOptions
[11/14/19 6:12:31 PM] {
[11/14/19 6:12:31 PM]   "CentralizedPoisonQueue": false
[11/14/19 6:12:31 PM] }
[11/14/19 6:12:31 PM] HttpOptions
[11/14/19 6:12:31 PM] {
[11/14/19 6:12:31 PM]   "DynamicThrottlesEnabled": false,
[11/14/19 6:12:31 PM]   "MaxConcurrentRequests": -1,
[11/14/19 6:12:31 PM]   "MaxOutstandingRequests": -1,
[11/14/19 6:12:31 PM]   "RoutePrefix": "api"
[11/14/19 6:12:31 PM] }
[11/14/19 6:12:31 PM] Starting JobHost
[11/14/19 6:12:31 PM] Starting Host (HostId=dylansimac-1683592573, InstanceId=6434be5e-93d7-4396-b3b6-18210eb5c1b3, Version=2.0.12858.0, ProcessId=1791, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[11/14/19 6:12:31 PM] Loading functions metadata
[11/14/19 6:12:31 PM] 1 functions loaded
[11/14/19 6:12:31 PM] Starting worker process:python  /Users/dylankaufman/.vscode/extensions/ms-python.python-2019.10.44104/pythonFiles/ptvsd_launcher.py --default --host 127.0.0.1 --port 9091 --wait "/usr/local/Cellar/azure-functions-core-tools/2.7.1846/workers/python/3.6/OSX/X64/worker.py" --host 127.0.0.1 --port 49342 --workerId df6ecb15-3eb4-4a36-91b0-9b2ff7ba9c8b --requestId 157838fe-6372-4275-8942-e96be7760f77 --grpcMaxMessageLength 134217728
[11/14/19 6:12:31 PM] python process with Id=1796 started
[11/14/19 6:12:31 PM] Generating 1 job function(s)
[11/14/19 6:12:32 PM] Found the following functions:
[11/14/19 6:12:32 PM] Host.Functions.DataPipeline
[11/14/19 6:12:32 PM] 
[11/14/19 6:12:32 PM] Initializing function HTTP routes
[11/14/19 6:12:32 PM] No HTTP routes mapped
[11/14/19 6:12:32 PM] 
[11/14/19 6:12:32 PM] Host initialized (204ms)
[11/14/19 6:12:32 PM] The next 5 occurrences of the 'DataPipeline' schedule (Cron: '45 12 * * * *') will be:
[11/14/19 6:12:32 PM] 11/14/2019 10:12:45-08:00 (11/14/2019 18:12:45Z)
[11/14/19 6:12:32 PM] 11/14/2019 11:12:45-08:00 (11/14/2019 19:12:45Z)
[11/14/19 6:12:32 PM] 11/14/2019 12:12:45-08:00 (11/14/2019 20:12:45Z)
[11/14/19 6:12:32 PM] 11/14/2019 13:12:45-08:00 (11/14/2019 21:12:45Z)
[11/14/19 6:12:32 PM] 11/14/2019 14:12:45-08:00 (11/14/2019 22:12:45Z)
[11/14/19 6:12:32 PM] 
[11/14/19 6:12:32 PM] Host started (661ms)
[11/14/19 6:12:32 PM] Job host started
Hosting environment: Production
Content root path: /Users/dylankaufman/Documents/Projects/SuccessHacker/Data Pipeline
Now listening on: http://0.0.0.0:7106
Application started. Press Ctrl+C to shut down.
[11/14/19 6:12:37 PM] Host lock lease acquired by instance ID '0000000000000000000000001F72728D'.
[11/14/19 6:12:37 PM]  INFO: Starting Azure Functions Python Worker.
[11/14/19 6:12:37 PM]  INFO: Worker ID: df6ecb15-3eb4-4a36-91b0-9b2ff7ba9c8b, Request ID: 157838fe-6372-4275-8942-e96be7760f77, Host Address: 127.0.0.1:49342
[11/14/19 6:12:37 PM]  INFO: Successfully opened gRPC channel to 127.0.0.1:49342
[11/14/19 6:12:37 PM]  INFO: Received WorkerInitRequest, request ID 157838fe-6372-4275-8942-e96be7760f77
[11/14/19 6:12:37 PM]  INFO: Received FunctionLoadRequest, request ID: 157838fe-6372-4275-8942-e96be7760f77, function ID: 606c4f57-13c0-4282-8cda-2026ab1902af
[11/14/19 6:12:45 PM] Executing 'Functions.DataPipeline' (Reason='Timer fired at 2019-11-14T10:12:45.0183320-08:00', Id=b66cfc0e-8e35-4ac3-bb47-1bf7d2058ab2)
[11/14/19 6:12:45 PM] Executed 'Functions.DataPipeline' (Failed, Id=b66cfc0e-8e35-4ac3-bb47-1bf7d2058ab2)
[11/14/19 6:12:45 PM] System.Private.CoreLib: Exception while executing function: Functions.DataPipeline. System.Private.CoreLib: Result: Failure
[11/14/19 6:12:45 PM] Exception: ModuleNotFoundError: No module named 'SharedCode'
[11/14/19 6:12:45 PM] Stack:   File "/usr/local/Cellar/azure-functions-core-tools/2.7.1846/workers/python/3.6/OSX/X64/azure_functions_worker/dispatcher.py", line 242, in _handle__function_load_request
[11/14/19 6:12:45 PM]     func_request.metadata.entry_point)
[11/14/19 6:12:45 PM]   File "/usr/local/Cellar/azure-functions-core-tools/2.7.1846/workers/python/3.6/OSX/X64/azure_functions_worker/loader.py", line 66, in load_function
[11/14/19 6:12:45 PM]     mod = importlib.import_module(fullmodname)
[11/14/19 6:12:45 PM]   File "/Users/dylankaufman/Documents/Projects/SuccessHacker/Data Pipeline/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
[11/14/19 6:12:45 PM]     return _bootstrap._gcd_import(name[level:], package, level)
[11/14/19 6:12:45 PM]   File "/Users/dylankaufman/Documents/Projects/SuccessHacker/Data Pipeline/DataPipeline/etl.py", line 6, in <module>
[11/14/19 6:12:45 PM]     from SharedCode import FunctionApp
[11/14/19 6:12:45 PM] .

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

I don't know how to enable source map support... 

pip freeze (after I upgraded some of the azure stuff):

adal==1.2.1
asn1crypto==0.24.0
astroid==2.2.5
azure==4.0.0
azure-applicationinsights==0.1.0
azure-batch==4.1.3
azure-common==1.1.23
azure-core==1.0.0
azure-cosmosdb-nspkg==2.0.2
azure-cosmosdb-table==1.0.5
azure-datalake-store==0.0.44
azure-eventgrid==1.2.0
azure-functions==1.0.4
azure-functions-worker==1.0.1
azure-graphrbac==0.40.0
azure-keyvault==1.1.0
azure-loganalytics==0.1.0
azure-mgmt==4.0.0
azure-mgmt-advisor==1.0.1
azure-mgmt-applicationinsights==0.1.1
azure-mgmt-authorization==0.50.0
azure-mgmt-batch==5.0.1
azure-mgmt-batchai==2.0.0
azure-mgmt-billing==0.2.0
azure-mgmt-cdn==3.1.0
azure-mgmt-cognitiveservices==3.0.0
azure-mgmt-commerce==1.0.1
azure-mgmt-compute==4.6.2
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.4.1
azure-mgmt-containerregistry==2.7.0
azure-mgmt-containerservice==4.4.0
azure-mgmt-cosmosdb==0.4.1
azure-mgmt-datafactory==0.6.0
azure-mgmt-datalake-analytics==0.6.0
azure-mgmt-datalake-nspkg==3.0.1
azure-mgmt-datalake-store==0.5.0
azure-mgmt-datamigration==1.0.0
azure-mgmt-devspaces==0.1.0
azure-mgmt-devtestlabs==2.2.0
azure-mgmt-dns==2.1.0
azure-mgmt-eventgrid==1.0.0
azure-mgmt-eventhub==2.5.0
azure-mgmt-hanaonazure==0.1.1
azure-mgmt-iotcentral==0.1.0
azure-mgmt-iothub==0.5.0
azure-mgmt-iothubprovisioningservices==0.2.0
azure-mgmt-keyvault==1.1.0
azure-mgmt-loganalytics==0.2.0
azure-mgmt-logic==3.0.0
azure-mgmt-machinelearningcompute==0.4.1
azure-mgmt-managementgroups==0.1.0
azure-mgmt-managementpartner==0.1.0
azure-mgmt-maps==0.1.0
azure-mgmt-marketplaceordering==0.1.0
azure-mgmt-media==1.0.0
azure-mgmt-monitor==0.5.2
azure-mgmt-msi==0.2.0
azure-mgmt-network==2.6.0
azure-mgmt-notificationhubs==2.0.0
azure-mgmt-nspkg==3.0.2
azure-mgmt-policyinsights==0.1.0
azure-mgmt-powerbiembedded==2.0.0
azure-mgmt-rdbms==1.8.0
azure-mgmt-recoveryservices==0.3.0
azure-mgmt-recoveryservicesbackup==0.3.0
azure-mgmt-redis==5.0.0
azure-mgmt-relay==0.1.0
azure-mgmt-reservations==0.2.1
azure-mgmt-resource==2.1.0
azure-mgmt-scheduler==2.0.0
azure-mgmt-search==2.0.0
azure-mgmt-servicebus==0.5.3
azure-mgmt-servicefabric==0.2.0
azure-mgmt-signalr==0.1.1
azure-mgmt-sql==0.9.1
azure-mgmt-storage==2.0.0
azure-mgmt-subscription==0.2.0
azure-mgmt-trafficmanager==0.50.0
azure-mgmt-web==0.35.0
azure-nspkg==3.0.2
azure-servicebus==0.21.1
azure-servicefabric==6.3.0.0
azure-servicemanagement-legacy==0.20.6
azure-storage-blob==1.5.0
azure-storage-common==1.4.2
azure-storage-file==1.4.0
azure-storage-queue==1.4.0
cachetools==3.1.1
certifi==2019.3.9
cffi==1.12.3
chardet==3.0.4
cryptography==2.6.1
google-api-python-client==1.7.9
google-auth==1.6.3
google-auth-httplib2==0.0.3
google-auth-oauthlib==0.3.0
grpcio==1.14.2
grpcio-tools==1.14.2
gspread==3.1.0
httplib2==0.13.0
idna==2.8
isodate==0.6.0
isort==4.3.17
lazy-object-proxy==1.3.1
mccabe==0.6.1
msrest==0.6.10
msrestazure==0.6.0
numpy==1.16.2
oauth2client==4.1.3
oauthlib==3.0.1
pandas==0.24.2
protobuf==3.7.0
ptvsd==4.2.8
pyasn1==0.4.5
pyasn1-modules==0.2.5
pycparser==2.19
pycrypto==2.6.1
pycryptodome==3.8.1
PyJWT==1.7.1
pylint==2.3.1
pyodbc==4.0.26
python-dateutil==2.8.0
pytz==2018.9
requests==2.21.0
requests-oauthlib==1.2.0
rsa==4.0
six==1.12.0
SQLAlchemy==1.3.2
typed-ast==1.3.4
uritemplate==3.0.0
urllib3==1.24.2
wrapt==1.11.1
brettcannon commented 5 years ago

Your import error is not because of the extension but due to how Azure Functions works and how you specified your import. Basically you either need to change it to from __app__.SharedCode import FunctionApp or from .SharedCode import FunctionApp. See https://github.com/Azure/azure-functions-python-worker/issues/469 on details.

dxkaufman commented 5 years ago

@brettcannon, thanks for the response. I tried from .SharedCode import FunctionApp and got this error: Attempted relative import beyond top-level package.
Is this because of a recent change?

I will try moving all of my code into an app directory and maybe the from __app__.SharedCode import FunctionApp option will work.

dxkaufman commented 5 years ago

Unfortunately, now with my DataPipeline and SharedCode directories under the __app__ directory, I get this error message:

No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

I am trying to use the pvscbot code mentioned in the issue you linked to figure out what's wrong, but I'm not seeing it. I now have the following:

Data Pipeline
 | - __app__
 | | - DataPipeline
 | | | - etl.py
 | | | - function.json
 | | - SharedCode
 | | | - APIs.py
 | | | - FunctionApp.py
 | | - host.json
 | | - local.settings.json
 | - .vscode (dir)
 | - env (dir)
 | - host.json
 | - local.settings.json

I can't see what in pvscbot is telling it that the function is at __app__/github/function.json.

brettcannon commented 5 years ago

@dxkaufman Unfortunately at this point you will need to reach out to the Azure Functions team for help.

dxkaufman commented 5 years ago

Thanks, @brettcannon; what would you say is the best way to do that? Via one of the Azure Functions python packages in github?

brettcannon commented 5 years ago

@dxkaufman You can try the repo I linked to earlier and see where they redirect you

dxkaufman commented 5 years ago

@brettcannon, yeah, that's what I'm about to do. Thanks.